#33491 closed Cleanup/optimization (fixed)
Rows are selected only on Chrome when going back from the confirmation page.
Reported by: | Akihito Yokose | Owned by: | Marcelo Galigniana |
---|---|---|---|
Component: | contrib.admin | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Marcelo Galigniana | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
Attachments (4)
Change History (16)
Changed 22 months ago by
Attachment: | image_01.png added |
---|
Changed 22 months ago by
Attachment: | image_02.png added |
---|
Changed 22 months ago by
Attachment: | django_2_2.mp4 added |
---|
Changed 22 months ago by
Attachment: | django_3_2.mp4 added |
---|
comment:1 Changed 22 months ago by
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
Summary: | Missing feature in actions.js (Django 3.2 and later) → Selected rows are not highlighted when going back from the confirmation page. |
comment:2 Changed 22 months ago by
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
comment:3 Changed 22 months ago by
Has patch: | set |
---|---|
Needs tests: | set |
Patch needs improvement: | set |
Resolution: | needsinfo |
Status: | closed → new |
Summary: | Selected rows are not highlighted when going back from the confirmation page. → Rows are selected only on Chrome when going back from the confirmation page. |
Triage Stage: | Unreviewed → Accepted |
Type: | Bug → Cleanup/optimization |
Thanks for details. I'd say it wasn't 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.
comment:4 Changed 22 months ago by
Has patch: | unset |
---|---|
Needs tests: | unset |
Patch needs improvement: | unset |
comment:5 Changed 17 months ago by
Cc: | Marcelo Galigniana added |
---|
comment:6 Changed 17 months ago by
Owner: | changed from nobody to Marcelo Galigniana |
---|---|
Status: | new → assigned |
comment:8 Changed 16 months ago by
Patch needs improvement: | set |
---|
comment:9 Changed 16 months ago by
Patch needs improvement: | unset |
---|
comment:10 Changed 16 months ago by
Triage Stage: | Accepted → Ready for checkin |
---|
For me, it works exactly the same in Django 2.2 and 3.2, in both cases rows are not highlighted or selected. Can you provide a sample project that reproduces this issue?