Open
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have validated any HTML to avoid common problems
- I have read the contributing guidelines
Describe the issue
The data-bs-target css selector doesn't works with complex selector like "#myDiv:not(.show)".
I have checked it with the dropdown and collapse components.
It works in version 5.2, but not 5.3.3
This is useful if you want a button to open a collapse, without being able to close it when you click again.
Reduced test cases
<button class="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#myDiv:not(.show)">Open</button>
<div id="myDiv" class="collapse">Hidden message</div>
If you rename the div id to <div id="myDiv:not(.show)"></div>
(what is a wrong thing to do), it toggle the collapse again.
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome
What version of Bootstrap are you using?
5.3.3
Metadata
Metadata
Assignees
Labels
No labels
Activity