#31220 closed Bug (invalid)
Widgets ignores "cols" attribute.
Reported by: | david html | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 3.0 |
Severity: | Normal | Keywords: | widgets |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I have tried two different packages and it appears that the cols attribute for Widget doesn't recognise the "cols" attribute
example 1
class PostAdmin(admin.ModelAdmin): formfield_overrides = { models.TextField: {'widget': AdminMarkdownxWidget (attrs={'rows': 5, 'cols': 100, 'style': ' font-size: 1.5em; font-family: HelveticaNeue;'})}, }
rows and style work fine, cols doesn't change the admin form
example 2
models.TextField: {'widget': AdminPagedownWidget(attrs={'rows':20, 'cols':200, 'style': ' font-size: 1.2em;' })},
I also note that in the documentation (https://docs.djangoproject.com/en/3.0/ref/forms/widgets/#textarea ) doesn't refer to the cols attribute so I wonder if it can still be changed
Change History (4)
follow-up: 2 comment:1 by , 5 years ago
Component: | Uncategorized → Forms |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Summary: | Widgets ignores cols attribute → Widgets ignores "cols" attribute. |
comment:2 by , 5 years ago
Replying to felixxm:
It works with builtin widgets e.g.
forms.Textarea
, so it's not an issue in Django but in 3rd party packages.
thanks for your fast reply.
could you please tell me how to test this e.g. without using the AdminMarkdownxWidget ? I mean replacing the admin TextField attributes. I did search in the manual but there is no example with cols. Also I am not looking to rewrite any css of the admin or using this in Django forms. Just to change it in the admin. I did try removing the widget AdminMarkdownx and it still doesn't resize.
follow-up: 4 comment:3 by , 5 years ago
You can just use forms.Textarea
instead of AdminMarkdownxWidget
.
comment:4 by , 5 years ago
Replying to felixxm:
You can just use
forms.Textarea
instead ofAdminMarkdownxWidget
.
Thank you, much appreciated. I can confirm that it was an issue with the external package
It works with builtin widgets e.g.
forms.Textarea
, so it's not an issue in Django but in 3rd party packages.