#29045: Multiple select widget does not honor size attribute
-------------------------------+--------------------------------------
     Reporter:  Jonah Bishop   |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  contrib.admin  |                  Version:  1.11
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by Jonah Bishop:

Old description:

> I have an admin page set up for a model like so:
>
> {{{
> @admin.register(p_models.ScheduleType)
> class ScheduleTypeAdmin(admin.ModelAdmin):
>     formfield_overrides = {
>         models.ManyToManyField: {'widget':
> forms.SelectMultiple(attrs={'size': '30'})},
>     }
>
>     list_display = ('name',)
> }}}
>
> The resulting ManyToMany field has the **size** attribute set properly,
> but every browser I try only shows about 8 rows (not 30, as I
> instructed). I've cleared cache, and tried in multiple browsers (Chrome
> 63, Firefox 57). My site uses Django 1.11.9.

New description:

 I have an admin page set up for a model like so:

 {{{
 @admin.register(p_models.ScheduleType)
 class ScheduleTypeAdmin(admin.ModelAdmin):
     formfield_overrides = {
         models.ManyToManyField: {'widget':
 forms.SelectMultiple(attrs={'size': '30'})},
     }

     list_display = ('name',)
 }}}

 The resulting ManyToMany field has the **size** attribute set properly,
 but every browser I try only shows about 8 rows (not 30, as I instructed).
 I've cleared cache, and tried in multiple browsers (Chrome 63, Firefox
 57). My site uses Django 1.11.9.

 It looks like the CSS style rules are overriding the **size** attribute.
 I'm guessing adding a **height: auto;** rule to the **select[multiple]**
 style set would fix it (it appears to do so in Chrome, at least).

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29045#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.536813c8da7f97dd84864ea9ed158c4d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to