[Django] #35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong place

24 views
Skip to first unread message

Django

unread,
Apr 4, 2024, 1:42:45 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-----------------------------------------+------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
The label for Django Admin filter fields is appearing after the fields,
instead of before. I'm using v5.0.4.

If I use the previous version of static/admin/SelectFilter2.js
https://github.com/django/django/blob/e3a4cee081cf60650b8824f0646383b79cb110e7/django/contrib/admin/static/admin/js/SelectFilter2.js
then the problem is fixed.

Images to explain: https://imgur.com/a/QfXjLLM

(Via the forum https://forum.djangoproject.com/t/label-not-rendering-
above-field/29821/)
--
Ticket URL: <https://code.djangoproject.com/ticket/35353>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 4, 2024, 1:43:43 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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
-------------------------------+--------------------------------------
Changes (by Phil Gyford):

* Attachment "Screenshot of label in wrong place.png" added.

Screenshot of label in wrong place

Django

unread,
Apr 4, 2024, 1:44:12 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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
-------------------------------+--------------------------------------
Changes (by Phil Gyford):

* Attachment "HTML of label in wrong place.png" added.

HTML showing label in wrong place

Django

unread,
Apr 4, 2024, 1:44:48 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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
-------------------------------+--------------------------------------
Changes (by Phil Gyford):

* Attachment "Screenshot of label using previous version of
SelectFilter2.js.png" added.

Screenshot of label using previous version of SelectFilter2.js

Django

unread,
Apr 4, 2024, 1:45:16 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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
-------------------------------+--------------------------------------
Changes (by Phil Gyford):

* Attachment "HTML of label using previous version of SelectFilter2.png"
added.

HTML of label using previous version of SelectFilter2.js

Django

unread,
Apr 4, 2024, 1:46:01 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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 Phil Gyford:

Old description:

> The label for Django Admin filter fields is appearing after the fields,
> instead of before. I'm using v5.0.4.
>
> If I use the previous version of static/admin/SelectFilter2.js
> https://github.com/django/django/blob/e3a4cee081cf60650b8824f0646383b79cb110e7/django/contrib/admin/static/admin/js/SelectFilter2.js
> then the problem is fixed.
>
> Images to explain: https://imgur.com/a/QfXjLLM
>
> (Via the forum https://forum.djangoproject.com/t/label-not-rendering-
> above-field/29821/)

New description:

The label for Django Admin filter fields is appearing after the fields,
instead of before. I'm using v5.0.4.

If I use the previous version of static/admin/SelectFilter2.js
https://github.com/django/django/blob/e3a4cee081cf60650b8824f0646383b79cb110e7/django/contrib/admin/static/admin/js/SelectFilter2.js
then the problem is fixed.

(Via the forum https://forum.djangoproject.com/t/label-not-rendering-
above-field/29821/)

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

Django

unread,
Apr 4, 2024, 3:41:47 PM4/4/24
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution: worksforme
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* resolution: => worksforme
* status: new => closed
* ui_ux: 0 => 1

Comment:

Hello Phil, thank you for your report. I have seen the screenshots and the
forum topic, but I'm not being able to reproduce. What you see may be a
side effect of a custom CSS that you may have? Or a third party package
providing a custom CSS? Or a lack of proper CSS reload/serve when
upgrading?

Given that I can't reproduce in any way (I tried various screen sizes and
screen modes), I'll be closing this ticket as invalid following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process]. If you could provide a
way to reliable reproduce, either by providing detailed instructions or a
django minimal test project, please re-open with the new information.

You could also seek further debugging help in the forum by continuing the
conversation there.
--
Ticket URL: <https://code.djangoproject.com/ticket/35353#comment:2>

Django

unread,
May 23, 2025, 4:26:45 AM5/23/25
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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: 1
-------------------------------+--------------------------------------
Changes (by Zbigniew Skowron):

* resolution: worksforme =>
* status: closed => new

Comment:

This is a bug in `django/contrib/admin/static/admin/js/SelectFilter2.js`.
This code in `SelectFilter2.js` puts the widget before the label:

{{{
// Make sure the selector div is at the beginning so that the
// add link would be displayed to the right of the widget.
from_box.parentNode.prepend(selector_div);
}}}

It works only if `RelatedFieldWidgetWrapper` is used, as the wrapper puts
the widget inside a separate `<div>`, so `prepend()` doesn’t reorder
widget with respect to the label.
Without the `RelatedFieldWidgetWrapper` we get the bug.
--
Ticket URL: <https://code.djangoproject.com/ticket/35353#comment:3>

Django

unread,
May 23, 2025, 4:31:18 AM5/23/25
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 5.0
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: 1
-------------------------------+--------------------------------------
Comment (by Sarah Boyce):

I believe this might be a duplicate of #36053
--
Ticket URL: <https://code.djangoproject.com/ticket/35353#comment:4>

Django

unread,
May 23, 2025, 5:23:28 AM5/23/25
to django-...@googlegroups.com
#35353: SelectFilter2.js puts the label for Django Admin filter fields in the wrong
place
-------------------------------+--------------------------------------
Reporter: Phil Gyford | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.0
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):

* resolution: => duplicate
* status: new => closed

--
Ticket URL: <https://code.djangoproject.com/ticket/35353#comment:5>
Reply all
Reply to author
Forward
0 new messages