django icon indicating copy to clipboard operation
django copied to clipboard

Fixed #33491 -- Rows are selected only on Chrome when going back from the confirmation page.

Open mgaligniana opened this issue 1 year ago • 1 comments

Ticket

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

mgaligniana avatar Aug 10 '22 01:08 mgaligniana

buildbot, test on selenium.

mgaligniana avatar Aug 10 '22 01:08 mgaligniana

https://github.com/django/django/blob/35911078fa40eb35859832987fedada76963c01e/django/contrib/admin/static/admin/css/changelists.css#L261-L263

For a :has() experiment.

carltongibson avatar Aug 11 '22 08:08 carltongibson

@mgaligniana Just on the autocomplete attribute, what's the intent there?

From the MDN docs

... 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?

🤔

carltongibson avatar Aug 11 '22 09:08 carltongibson

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! 🤗

mgaligniana avatar Aug 15 '22 06:08 mgaligniana

buildbot, test on selenium.

mgaligniana avatar Aug 16 '22 17:08 mgaligniana

@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?

mgaligniana avatar Aug 16 '22 18:08 mgaligniana

@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)

mgaligniana avatar Aug 17 '22 11:08 mgaligniana

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!

carltongibson avatar Aug 17 '22 11:08 carltongibson