-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
gatsby-plugin-catch-links: do not catch anchor links (href="#foobar") #2994
gatsby-plugin-catch-links: do not catch anchor links (href="#foobar") #2994
Conversation
Use anchor.hash instead of anchor.target.hash https://www.w3schools.com/jsref/prop_anchor_hash.asp Previously atleast IE 11 directed to page in / when there was <a> with href="#foobar" in non-root path, eg. /docs/
7351208
to
78eb6c7
Compare
Deploy preview ready! Built with commit 7351208041ace810aa4ccee1073cd6327daf420e |
Deploy preview ready! Built with commit 7351208041ace810aa4ccee1073cd6327daf420e |
Deploy preview ready! Built with commit a423969 |
Deploy preview ready! Built with commit a423969 |
Deploy preview failed. Built with commit cbdf09f https://app.netlify.com/sites/using-glamor/deploys/5a1c46c9a11477717ae5b7aa |
Huh, yeah. Targets don't have hashes true :-) Thanks for the fix! |
Hiya @TomiTakussaari! 👋 This is definitely late, but on behalf of the entire Gatsby community, I wanted to say thank you for being here. Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If you have questions, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! 💪💜 |
I noticed that IE 11 directed to page "/#foobar" when there was with href="#foobar" in page /docs/ (generated via markdown & with gatsby-plugin-catch-links enabled), which should have taken me to /docs/#foobar.
Chrome, Firefox and Edge worked fine though, not sure how they did that.
Fix seemed to be to use anchor.hash instead of anchor.target.hash.
anchor.target.hash does not exist afaik
https://www.w3schools.com/jsref/prop_anchor_hash.asp
https://www.w3schools.com/jsref/prop_anchor_target.asp