#36850 closed Bug (fixed)
Django Admin filter sidebar wraps if its inner content becomes too large
| Reported by: | Mark | Owned by: | Nilesh Pahari |
|---|---|---|---|
| Component: | contrib.admin | Version: | 6.0 |
| Severity: | Release blocker | Keywords: | css |
| Cc: | Antoliny | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | yes |
Description (last modified by )
In the course of ticket #36511 the layout of the changelist and its filter sidebar has been changed so that the sidebar seemingly should have a fixed width of 240px.
The flex-base property does not necessarily restrict the width of the sidebar if it's content demands more (which happens eg. for dropdowns with large titles). Combined with the flex: wrap attribute, the sidebar wraps if the table also demands more width than available and looks broken (see attachment).
This behavior can be simulated by giving a sidebar's and changelist's children some fixed, large width:
#changelist-filter-extra-actions {
width: 290px;
}
#toolbar {
width: 1000px;
}
The problem could be resolved by reverting to the previous flex layout, but the motivation for those changes is unclear to me from the ticket and related pr.
Should the width of the sidebar stick to 240px or - at it has been before - should the sidebar grow if necessary?
Does the new flex layout have any advantages to how it was in django <6?
Attachments (1)
Change History (18)
by , 3 weeks ago
| Attachment: | Screenshot from 2026-01-07 15-00-57.png added |
|---|
comment:1 by , 3 weeks ago
| Summary: | Django Admin filter sidebar wraps if it's inner content becomes to large → Django Admin filter sidebar wraps if it's inner content becomes too large |
|---|
comment:2 by , 3 weeks ago
| Description: | modified (diff) |
|---|
comment:3 by , 3 weeks ago
| Description: | modified (diff) |
|---|
comment:4 by , 3 weeks ago
| Description: | modified (diff) |
|---|---|
| Summary: | Django Admin filter sidebar wraps if it's inner content becomes too large → Django Admin filter sidebar wraps if its inner content becomes too large |
comment:5 by , 3 weeks ago
| Owner: | set to |
|---|---|
| Status: | new → assigned |
comment:6 by , 3 weeks ago
| Cc: | added |
|---|---|
| Description: | modified (diff) |
| Severity: | Normal → Release blocker |
| Triage Stage: | Unreviewed → Accepted |
comment:7 by , 2 weeks ago
| Has patch: | set |
|---|
comment:8 by , 2 weeks ago
follow-up: 11 comment:9 by , 2 weeks ago
Thank you for reporting this issue Mark :)
The goal of #36511 was to ensure that filter elements are reached before table elements during tab navigation (accessibility improvement).
And of course, the existing layout should have been maintained.
As mentioned above, it should have been kept identical to the existing layout, and I think maintaining it is the best approach.
In a way that allows the sidebar to grow as it did before.
If we remove flex-wrap and add min-width to the area where the table exists, I think we'll get the same layout as before even when the filter element's width increases.
comment:10 by , 2 weeks ago
| Patch needs improvement: | set |
|---|
comment:11 by , 2 weeks ago
Alright, makes sense. Just wanted to make sure, the flex-wrap change does not have any accessibility implications I don't get. I see, you are already pretty far with the PR from Nilesh. Thanks to both of you :)
comment:12 by , 2 weeks ago
| Patch needs improvement: | unset |
|---|
comment:13 by , 10 days ago
| Patch needs improvement: | set |
|---|
comment:14 by , 8 days ago
| Patch needs improvement: | unset |
|---|
comment:15 by , 3 days ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
PR https://github.com/django/django/pull/20528