Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tableselect: Ticking the "select all" checkbox breaks the table CSS style in Seven #4816

Open
klonos opened this issue Dec 19, 2020 · 3 comments

Comments

@klonos
Copy link
Member

klonos commented Dec 19, 2020

I've noticed this while working on #2714, and I initially thought that it had to do with the changes I was making, but it turns out that it is a pre-existing issue.

Steps to reproduce

  • On a vanilla Backdrop site, navigate to /admin/content or any other page that has a table with tableselect on + at least one or more items/rows (can be a views-generated table, or otherwise)
  • Start ticking the checkboxes on the table rows, one-by-one -> notice no change in the style of the table 👍
  • As you go, notice how both the selected and unselected rows retain their even/odd style ("zebra" colors) 👍
  • Also notice that when you hover over any row (selected or unselected), the background of the currently hovered-over row becomes yellow 👍
  • Tick all the checkboxes, but do NOT click the "select all" checkbox yet.
  • Eventually, once you have ticked all the other checkboxes, the "select all" checkbox gets automatically ticked -> still, no CSS style change on the table 👍
  • Hover over the rows, and notice the yellow background color as you hover over them 👍
  • Now, with all the checkboxes ticked, untick the "select all" checkbox -> all other checkboxes also get unticked 👍 ...and no CSS style change on the table 👍
  • Hover over the rows, and notice the yellow background color as you hover over them 👍
  • Finally, tick the "select all" checkbox, so that all rows are selected ...

Actual behavior

  • All rows on the table lose their "zebra" coloring, and get the yellow, hover-over background color instead. PERMANENTLY! 👎
  • All borders are gone from the table rows 👎
  • Try hovering over any row -> background color and row borders do not recover 👎
  • Try ticking or unticking any checkbox besides the "select all" checkbox -> background color and row borders do not recover 👎
  • The yellow background color does not go away, unless you tick the "select all" checkbox once again.

Expected behavior

The selected class that gets added to the table rows when ticking the "select all" checkbox does not override the Seven admin theme CSS that adds the "zebra" background colors and the borders in table rows.

@indigoxela
Copy link
Member

Hm, I always considered this as expected behavior. If all rows are selected, all get the "selected" class. I could be wrong, though.

@klonos
Copy link
Member Author

klonos commented Dec 19, 2020

I don't think so @indigoxela ...if one single row gets selected, then that should also get the .selected class, right? I mean why should selected rows receive this "special" CSS style only when all of them are selected, and not when individually selected? 🤷

@indigoxela
Copy link
Member

why should selected rows receive this "special" CSS style only when all of them are selected, and not when individually selected?

That's a valid point. It seems a little inconsistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants