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>
This commit is contained in:
Marcelo Galigniana 2022-08-17 11:04:23 +02:00 committed by Carlton Gibson
parent d46cc15c51
commit 0aa2f16e63
1 changed files with 4 additions and 1 deletions

View File

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