* cc: Marcelo Galigniana (added)
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. Row selections are preserved when using browser's
"Back" in Chrome only. As far as I'm aware, this is not an intended
feature, however we should keep the counter in sync or uncheck the rows.
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Marcelo Galigniana):
> Row selections are preserved when using browser's "Back" in Chrome only.
As far as I'm aware, this is not an intended feature
Correct! I did a fix to force the uncheck:
https://code.djangoproject.com/ticket/33491. Seems we have a bug +
add/force the row counter reset!
Cauê Thenório, do you want to work in a patch?
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:3>
Comment (by Cauê Thenório):
I did a test here with different browsers on MacOS:
- Chrome 113 keeps rows selected and the counter is reset ❌
- Safari 16.5 keeps rows selected and the counter is updated ✅
- Firefox 115 clear selection and the counter is updated ✅
Each browser has a different behavior but only Chrome gets the counter out
of sync.
Based on this discussion: https://github.com/django/django/pull/15938, it
looks like it was decided to keep Chrome's behavior as users may get used
to this behavior when using Chrome, and it saves user's work compared with
Firefox, where the user will need to reselect previously selected rows.
Yes Marcelo Galigniana, I would like to work on a patch. I believe it will
be a couple of the lines, to call the `updateCounter` function when the
page loads.
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:4>
Comment (by Cauê Thenório):
After some tests, I found out that Chrome restores the selection after
`Actions(actionsEls)` is executed, therefore calling `updateCounter` in
the body of `Actions` function won't work as Chrome didn't restore the
selection at that point.
In this comment:
https://bugs.chromium.org/p/chromium/issues/detail?id=1057463#c5
A Chrome developer states the values are restored after the `pageshow`
event: https://developer.mozilla.org/en-
US/docs/Web/API/Window/pageshow_event
I'll write a patch to run ` updateCounter` when the `pageshow` event is
triggered.
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:5>
* has_patch: 0 => 1
Comment:
PR: https://github.com/django/django/pull/17052
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"f7cfa48283c94018861688f17ab3935d588fbcc3" f7cfa482]:
{{{
#!CommitTicketReference repository=""
revision="f7cfa48283c94018861688f17ab3935d588fbcc3"
Fixed #34696 -- Updated selection counter in admin changelist on Chrome.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34696#comment:8>