[Django] #33491: Missing feature in actions.js (Django 3.2 and later)

60 views
Skip to first unread message

Django

unread,
Feb 3, 2022, 11:25:27 PM2/3/22
to django-...@googlegroups.com
#33491: Missing feature in actions.js (Django 3.2 and later)
------------------------------------------+------------------------
Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
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 |
------------------------------------------+------------------------
On the admin site, I've found a feature that existed in Django 2.2 but was
lost with the update to Django 3.2.

In Django 2.2, if you clicked the "No, take me back" button on the delete
confirmation page, the background color of the checked rows would remain
highlighted and the action-counter display would remain counted up on the
change list page. However, in Django 3.2, the background color of the
selected row is not highlighted and the action-counter display is "0 of X
selected" (see attached images).

The reason for this is probably that the following process in
django/contrib/admin/static/admin/js/actions.js was removed during the
update to Django 3.2.

{{{
// Show counter by default
$(options.counterContainer).show();
// Check state of checkboxes and reinit state if needed
$(this).filter(":checked").each(function(i) {
$(this).parent().parent().toggleClass(options.selectedClass);
updateCounter();
if ($(options.acrossInput).val() === 1) {
showClear();
}
});
}}}

A related Issue is https://github.com/django/django/pull/12820.

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

Django

unread,
Feb 3, 2022, 11:26:02 PM2/3/22
to django-...@googlegroups.com
#33491: Missing feature in actions.js (Django 3.2 and later)
--------------------------------+--------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
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 Akihito Yokose):

* Attachment "image_01.png" added.

Django

unread,
Feb 3, 2022, 11:26:13 PM2/3/22
to django-...@googlegroups.com
#33491: Missing feature in actions.js (Django 3.2 and later)
--------------------------------+--------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
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 Akihito Yokose):

* Attachment "image_02.png" added.

Django

unread,
Feb 4, 2022, 12:28:47 AM2/4/22
to django-...@googlegroups.com
#33491: Missing feature in actions.js (Django 3.2 and later)
--------------------------------+--------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
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 Mariusz Felisiak):

* Attachment "django_2_2.mp4" added.

Django

unread,
Feb 4, 2022, 12:28:56 AM2/4/22
to django-...@googlegroups.com
#33491: Missing feature in actions.js (Django 3.2 and later)
--------------------------------+--------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 3.2
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 Mariusz Felisiak):

* Attachment "django_3_2.mp4" added.

Django

unread,
Feb 4, 2022, 12:32:32 AM2/4/22
to django-...@googlegroups.com
#33491: Selected rows are not highlighted when going back from the confirmation
page.
--------------------------------+--------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: needsinfo

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 Mariusz Felisiak):

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


Comment:

For me, it works exactly the same in
[https://code.djangoproject.com/attachment/ticket/33491/django_2_2.mp4
Django 2.2] and
[https://code.djangoproject.com/attachment/ticket/33491/django_3_2.mp4
3.2], in both cases rows are not highlighted or selected. Can you provide
a sample project that reproduces this issue?

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

Django

unread,
Feb 4, 2022, 12:59:20 AM2/4/22
to django-...@googlegroups.com
#33491: Selected rows are not highlighted when going back from the confirmation
page.
--------------------------------+--------------------------------------
Reporter: Akihito Yokose | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: needsinfo

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------

Comment (by Akihito Yokose):

Mariusz, thanks for the info.

It may depend on your browser.
The results I checked on my Windows PC are as follows.

Chrome 98 and Edge 98:
- Django 2.2: OK
- Django 3.2: NG

However, the situation was different with Firefox.

Firefox 96:
- Django 2.2: NG
- Django 3.2: NG

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

Django

unread,
Feb 4, 2022, 1:27:12 AM2/4/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
--------------------------------------+------------------------------------

Reporter: Akihito Yokose | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

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

* status: closed => new
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* type: Bug => Cleanup/optimization
* has_patch: 0 => 1
* resolution: needsinfo =>
* stage: Unreviewed => Accepted


Comment:

Thanks for details. I'd say it was an intended feature, since it's browser
specific. IMO, we should enforce clearing checkboxes, instead of
highlighting rows on Chrome. This would make this behavior browser-
agnostic

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

Django

unread,
Feb 8, 2022, 5:56:30 AM2/8/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
--------------------------------------+------------------------------------
Reporter: Akihito Yokose | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

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


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

Django

unread,
Mar 22, 2022, 11:42:41 PM3/22/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner:
Type: | yash112-lang
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by yash112-lang):

* owner: nobody => yash112-lang
* status: new => assigned


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

Django

unread,
Mar 23, 2022, 1:30:17 AM3/23/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
--------------------------------------+------------------------------------
Reporter: Akihito Yokose | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Yash Singhal):

* owner: Yash Singhal => (none)
* status: assigned => new


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

Django

unread,
Jul 29, 2022, 5:50:30 AM7/29/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
--------------------------------------+------------------------------------
Reporter: Akihito Yokose | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* cc: Marcelo Galigniana (added)


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

Django

unread,
Jul 29, 2022, 10:31:25 AM7/29/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* owner: nobody => Marcelo Galigniana


* status: new => assigned


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

Django

unread,
Aug 9, 2022, 9:45:50 PM8/9/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Aug 16, 2022, 3:53:36 AM8/16/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


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

Django

unread,
Aug 16, 2022, 2:21:47 PM8/16/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* needs_better_patch: 1 => 0


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

Django

unread,
Aug 17, 2022, 5:07:59 AM8/17/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33491#comment:10>

Django

unread,
Aug 17, 2022, 5:50:10 AM8/17/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton@…>):

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


Comment:

In [changeset:"0aa2f16e63887d6053f6fd0da19254fc74c750ae" 0aa2f16e]:
{{{
#!CommitTicketReference repository=""
revision="0aa2f16e63887d6053f6fd0da19254fc74c750ae"
Fixed #33491 -- Fixed change-list selected row-highlight on cancelled
delete.

Selected rows where not highlighted when returning to the change-list
after clicking "No, take me back" on the deletion confirmation page.

This commit uses the CSS :has() pseudo-class to apply the highlight
without requiring the .selected class, which is added by JavaScript
on the click event.

Once all supported browsers have :has() available, the .selected
selector and the JavaScript to add the class can be removed.

Co-authored-by: Carlton Gibson <carlton...@noumenal.es>
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33491#comment:11>

Django

unread,
Aug 17, 2022, 8:19:15 AM8/17/22
to django-...@googlegroups.com
#33491: Rows are selected only on Chrome when going back from the confirmation
page.
-------------------------------------+-------------------------------------
Reporter: Akihito Yokose | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 3.2

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

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

Comment (by Carlton Gibson <carlton@…>):

In [changeset:"e1056ed5a2004a6cd3a345eda5522abd9e1efb3d" e1056ed5]:
{{{
#!CommitTicketReference repository=""
revision="e1056ed5a2004a6cd3a345eda5522abd9e1efb3d"
Refs #33491 -- Split CSS selected-row highlight selectors.

Combined selectors break the whole rule where :has() is not supported,
for example on Firefox.

Thanks to Marcelo Galigniana for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33491#comment:12>

Reply all
Reply to author
Forward
0 new messages