diff options
| author | Marcelo Galigniana <marcelogaligniana@gmail.com> | 2022-08-17 11:04:23 +0200 |
|---|---|---|
| committer | Carlton Gibson <carlton@noumenal.es> | 2022-08-17 11:49:34 +0200 |
| commit | 0aa2f16e63887d6053f6fd0da19254fc74c750ae (patch) | |
| tree | d11e1310b90ebd381f9fb4f072c1b7a266f840b7 | |
| parent | d46cc15c51219c3418e0287bf018c5ba1346f825 (diff) | |
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.gibson@noumenal.es>
| -rw-r--r-- | django/contrib/admin/static/admin/css/changelists.css | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/admin/static/admin/css/changelists.css b/django/contrib/admin/static/admin/css/changelists.css index 68ba55787b..aa872dcf70 100644 --- a/django/contrib/admin/static/admin/css/changelists.css +++ b/django/contrib/admin/static/admin/css/changelists.css @@ -258,7 +258,10 @@ vertical-align: baseline; } -#changelist table tbody tr.selected { +/* Once the :has() pseudo-class is supported by all browsers, the tr.selected + selector and the JS adding the class can be removed. */ +#changelist table tbody tr.selected, +#changelist table tbody tr:has(input[type=checkbox]:checked) { background-color: var(--selected-row); } |
