You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- Follow these instructions, please! --><divclass="container py-5"><h1class="h2">Bootstrap v5.0.2 Bug Report</h1><p>REPORT: IDs containing slashes do crash. Such IDs need to be escaped before going thu document.querySelector()</p><p><aclass="btn btn-primary" data-bs-toggle="collapse" href="#my/id" role="button" aria-expanded="false" aria-controls="my/id">
Link with href with my/id
</a><buttonclass="btn btn-primary" type="button" data-bs-toggle="collapse" data-bs-target="#my/id" aria-expanded="false" aria-controls="my/id">
Button with data-bs-target with my/id
</button></p><divclass="collapse" id="my/id"><divclass="card card-body">
Some placeholder content for the collapse component. This panel is hidden by default but revealed when the user activates the relevant trigger.
</div></div></div>
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
What version of Bootstrap are you using?
v5.0.2
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe the issue
When using collapse with IDs containing '/', the collapse does not work and crashes with the following error:
Uncaught DOMException: Document.querySelector: '#my/id' is not a valid selector
(tested with FFx, Chrome and Safari)This is because Document.querySelector expects the query to be properly escaped.
I think this might be fixed at
bootstrap/js/src/util/index.js
Line 55 in 886b940
=> by using something like
=> which would escape properly the selector in a suitable way for document.querySelector() to work properly
Reduced test cases
Minimal test case (can be pasted in https://codepen.io/team/bootstrap/pen/qBamdLj):
What operating system(s) are you seeing the problem on?
macOS
What browser(s) are you seeing the problem on?
No response
What version of Bootstrap are you using?
v5.0.2
The text was updated successfully, but these errors were encountered: