-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Normalize selector operation in scrollspy #41726
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
base: main
Are you sure you want to change the base?
Normalize selector operation in scrollspy #41726
Conversation
Co-authored-by: XhmikosR <[email protected]>
|
Thanks for the fix @DenisLopatin. @XhmikosR et all: What can be done to help get this merged and released? What are the roadblocks, if any?
|
|
@DenisLopatin - your solution works nicely! I couldn't wait for this to land, so I created a runtime patcher. Linking to it here in case it can be helpful to others in the meantime: https://www.docsy.dev/site/implementation/scrollspy-patch/ |
It's good. The bootstrap team is probably busy with their own business right now). |
Closes: #39198
Closes: #37858
Closes: #39248
Fix: #35566 (Hope, see below)
Description
Allows you to select the elements in the Scrollspy component that need to be escaped.
Motivation & Context
Users complain that they can't always control how their IDs for a component are filled in.
Type of changes
Checklist
npm run lint)Live previews
Related issues
#39198
#37858
#32586
#35566 (very important)
In PR #35566, @pierresouchay added a selector search mechanism when escaping
selector = selector.replaceAll(/#([^\s"#']+)/g, (match, id) => '#' + CSS.escape(id)). I removed the#symbol from there, as it interfered with the current implementation, but did not affect the previous functionality (during manual and automatic testing). I do not know why it was not necessary to escape the identifier inside the expression (#firistid#secondId is invalid), but the functionality works. In the worst case, it was necessary, but they just forgot to write the tests. At best, everything is fine.P.S. A lot of questions, so I will be glad to receive feedback))