-
Notifications
You must be signed in to change notification settings - Fork 13
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
Scroll to an element with ID with a leading number crashes #14
Comments
I have the same problem! |
Same problem. And these are valid HTML5 ids. |
gretchenfitze
added a commit
to gretchenfitze/scroll-to-element
that referenced
this issue
Jul 25, 2022
yes it's valid but usually doesn't work. Anyhow you can "escape" the id's with leading numbers in this way https://mothereff.in/css-escapes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! When scroll-to is used on an element with ID containing a leading number, it crashes on:
One solution I could find was to utilize the
CSS.escape
function to handle these cases. Something like:The crashing line is https://github.com/willhoag/scroll-to-element/blob/master/index.js#L30.
Thoughts?
The text was updated successfully, but these errors were encountered: