-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Collapse multi-target fails with "#id1, #id2" data-target selector #25273
Comments
An I don't know if there are (accessible) solutions for this situation. |
this is a valid bug related to http://getbootstrap.com/docs/4.0/components/collapse/#multiple-targets @MartijnCuppens as for the |
@MartijnCuppens , @patrickhlauke that's true about the |
@bpierson yes, which is why i'm saying that particular thing should be a separate issue. the problem you reported is valid as per your description (the valid jquery selector you provide, with the two ids, isn't working as it should) |
Won't SR's honor the |
Ping @Johann-S |
Possibly related to this line https://github.com/twbs/bootstrap/blob/v4-dev/js/src/util.js#L109 |
@Johann-S I just confirmed that to be the case by just changing the value to I understand the motivation in trying to sanitize the id, but it seems like in the case of a selector it's a losing battle. Presumably the coder supplied both the id value and the I might humbly suggest that to simplify your code base, js libraries should just take what the coder supplies for attribute values - even ids. |
Yep it seems they are a lot of use cases which are difficult to handle in our ends 😟 Maybe we should add a warning in our documentation and remove that code |
@Johann-S most systems that generate or template html have methods on the server side to sanitize id and attribute values before it ever gets to the browser. While it would technically be a breaking change, I doubt that it would have much impact. I've been programming about 30 years and in my experience, many issues are created by changing the value supplied by the user (side-effects). I've even run into problems just trimming off whitespace! |
I've run into this problem also, not with multiple targets but just using a more complicated target spec that started with |
Fiddle
With a comma-separated CSS selector, the targeted collapsible elements are not toggled, for example:
data-target="#coll1, #coll2"
No error is raised.
The text was updated successfully, but these errors were encountered: