[Django] #33024: filter_horizontal doesn't use full height when in collapsed fieldset

32 views
Skip to first unread message

Django

unread,
Aug 14, 2021, 9:22:41 AM8/14/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter | Owner: nobody
Tillema |
Type: | Status: new
Uncategorized |
Component: | Version: 3.2
contrib.admin | Keywords: filter_horizontal,
Severity: Normal | fieldsets, admin
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-------------------------------------+-------------------------------------
Say you have a field `field` in model `X`, which is a `ManyToMany` field.
You can use `filter_horizontal` in the `ModelAdmin` to display the
available and selected options. However, if you use `filter_horizontal` in
combination with a fieldset which is collapsed by default, it won't take
the full height.

Example:

{{{
#!python
@admin.register(X)
class XAdmin(admin.ModelAdmin):
list_display = ('a', 'b', 'c', 'field')
filter_horizontal = ('field',)

fieldsets = (
(None, {
'fields': ('a', 'b', 'c')
}),
('Other', {
'classes': ('collapse',),
'fields': ('field',)
})
)
}}}

which gets rendered as https://i.imgur.com/jZpUHYN.png

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

Django

unread,
Aug 14, 2021, 1:42:49 PM8/14/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage:
fieldsets, admin | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Peter Tillema):

* type: Uncategorized => Bug


--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:1>

Django

unread,
Aug 17, 2021, 4:19:30 AM8/17/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* stage: Unreviewed => Accepted


Comment:

Hi Peter — OK, thanks. If you'd like to look at an adjustment here, that
would be great!

--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:2>

Django

unread,
Nov 17, 2021, 5:14:25 AM11/17/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned

Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Shubh Parmar):

* cc: Shubh Parmar (added)
* owner: nobody => Shubh Parmar
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:3>

Django

unread,
Nov 17, 2021, 6:57:50 AM11/17/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Shubh Parmar):

PR: [https://github.com/django/django/pull/15096]

--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:4>

Django

unread,
Nov 17, 2021, 7:10:51 AM11/17/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:5>

Django

unread,
Nov 18, 2021, 1:20:52 AM11/18/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_tests: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:6>

Django

unread,
Nov 19, 2021, 3:41:18 AM11/19/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Shubh Parmar):

* Attachment "ticket_33024.diff" added.

Django

unread,
Nov 19, 2021, 3:42:03 AM11/19/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Accepted
fieldsets, admin |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------

Comment (by Shubh Parmar):

I think we can solve this issue with just CSS. In that case, we don't need
to write javascript for calculating the height of select boxes. I have
uploaded a git diff file. Let me know whether this is okay or not.

--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:7>

Django

unread,
Nov 25, 2021, 1:59:16 AM11/25/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: filter_horizontal, | Triage Stage: Ready for
fieldsets, admin | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:8>

Django

unread,
Nov 25, 2021, 2:07:49 PM11/25/21
to django-...@googlegroups.com
#33024: filter_horizontal doesn't use full height when in collapsed fieldset
-------------------------------------+-------------------------------------
Reporter: Peter Tillema | Owner: Shubh
| Parmar
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: filter_horizontal, | Triage Stage: Ready for
fieldsets, admin | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"51c24d8799fb09f04d0a5deb713eaeceb20d15c7" 51c24d87]:
{{{
#!CommitTicketReference repository=""
revision="51c24d8799fb09f04d0a5deb713eaeceb20d15c7"
Fixed #33024 -- Fixed height of admin selector boxes in collapsed
fieldset.

Thanks Tom Carrick for the review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33024#comment:9>

Reply all
Reply to author
Forward
0 new messages