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

[bug]Selected and Hover colors not showing in Bootstrap #2399

Closed
MarcPinnell opened this issue Aug 22, 2024 · 3 comments
Closed

[bug]Selected and Hover colors not showing in Bootstrap #2399

MarcPinnell opened this issue Aug 22, 2024 · 3 comments

Comments

@MarcPinnell
Copy link

Describe the bug

Using multi-drag/select on a Bootstrap styled table. When clicking the rows the proper CSS style is applied to the code, but the screen doesn't show the new colors for the row.

To Reproduce
If the table is set as:
<table id="reorder-table" class="">
then the colors from the custom CSS work fine.

if the table is set as:
<table id="reorder-table" class="table">
Then the custom CSS colors do not override the table row colors set by Bootstrap - even if the custom color definitions are:
background-color: red !important;

Expected behavior
Per the demos, when you click a row it should highlight

Information

sortablejs = 1.15.2
bootstrap = 5.3.3

@owen-m1
Copy link
Member

owen-m1 commented Sep 7, 2024

Would you be able to provide a JSBin reproduction please? This sounds more like a CSS issue than Sortable

@owen-m1
Copy link
Member

owen-m1 commented Sep 7, 2024

Okay I was able to reproduce this. It's bootstrap adding a bg color to the td elements themselves.
Add this CSS:

.table>:not(caption)>*>* {
  background-color: transparent !important;
}

https://jsbin.com/zadenitoko/2/edit?html,css,js,output

@owen-m1 owen-m1 closed this as completed Sep 7, 2024
@MarcPinnell
Copy link
Author

Thanks for figuring it out. I ended up removing the bootstrap styling and adding my own to solve it. I will keep this for the future though!

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

No branches or pull requests

2 participants