django
django copied to clipboard
Fixed #33491 -- Rows are selected only on Chrome when going back from the confirmation page.
First, thank you Mariusz for Ccme in this ticket!
In this PR I apply your suggestion of
we should enforce clearing checkboxes, instead of highlighting rows on Chrome. This would make this behavior browser-agnostic.
To run the test please do: ./runtests.py admin_views.tests.SeleniumTests.test_clear_checkboxes_after_go_back --selenium=<browser> --parallel=1
with browser
as chrome
, firefox
or safari
buildbot, test on selenium.
https://github.com/django/django/blob/35911078fa40eb35859832987fedada76963c01e/django/contrib/admin/static/admin/css/changelists.css#L261-L263
For a :has()
experiment.
@mgaligniana Just on the autocomplete
attribute, what's the intent there?
... This attribute has no effect on input types that do not return numeric or text data, being valid for all input types except checkbox, radio, file, or any of the button types....
So this isn't going to do anything in this case is it?
🤔
So this isn't going to do anything in this case is it?
🤔
Ohh! I missed that part! But for some reason, in Google and Safari seems it was working because it unchecked the action-toggle
checkbox, anyway, I updated and now I do it via JS, to be more consitent and have less diff! Thanks Carlton!
Regarding your 1st comment, I agree, the "With this patch I'd need to reselect all the rows again" could be very annoying for the user experience and it's how is currently working in Firefox and for that I liked the 'agnostic' idea, but the "they're different, we like diversity, and folks get used to the native behaviour of the browser they use" it's also true! 😵💫 haha. I'm in favor what you decide! 🤗
buildbot, test on selenium.
@carltongibson I added the :has()
and updated the tests, but they are too specific to each browser: as each browser starts to support the has
property, tests are going to break and we should start deleting the conditionals. Is it the way?
@carltongibson 📣 ⚠️
If you combine the two selectors, the highlighted doesn't work even when you click the checbox for 1st time! I divided in two different classes because, I think, as the has()
is not supported it breaks the whole style rule (in Chrome and Firefox). To reproduce it you can add my test diff in main and run it (or just open an admin and click any checkbox of a model list)
Ah, yes. Good spot @mgaligniana.
See #15965
as the has() is not supported it breaks the whole style rule
I wan't expecting that. Naughty browsers 🙂
Thanks!