-
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
Anchor Links, part 2 #386
Comments
D'oh - https://github.com/adjohnson916/anchorate#gatsby - I will try that. |
Works great! Should we add it to starters, README, or both? |
Don't think they need to be in starters (other than perhaps the documentation one) but yeah, this would be great to add to the README. |
|
hmmm... that is a good point actually. I added react-router-scroll for the On Wed, Aug 10, 2016 at 9:41 PM Ivan Storck [email protected]
|
Maybe taking this one step further, it might be cool to be able to opt-in to have anchors auto-generated for all |
@rojobuffalo you can use something like |
@ivanoats are you sure it is working 100% of the time? i tested it in my project and the result is almost the same as without using anchorate. |
The correct way to fix this would involve stopping a re render in the first place. anchorate gets called only after the route is changed |
Pretty sure. I haven't had any issues from manual testers. I would be interested in an automated test. Sent from my iPhone
|
Confirmed this is a |
As far as exports.onRouteUpdate = (location) => {
if (location.hash) {
setTimeout(() => {
document.querySelector(`${location.hash}`).scrollIntoView();
}, 0);
}
}; |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Without the hashtags they open new pages => 404 Anchor links don't work on chrome, tried this but didn't have much success 😔 gatsbyjs/gatsby#386 (comment)
native HTML anchor links are broken, even using import { navigate } from "@reach/router";
<div className="custom-link" onClick={() => {navigate("#section_id")}}>Section</div> *But my website works with and without |
navigate doesn't work for me either. I get redirected to my index page. |
Is there a plan to support or document how to make anchor links work?
I know #302 is closed for now, but it's not clear how to work-around.
I have a fork of gatsby-starter-default that reproduces the error here: https://github.com/ivanoats/gatsby-starter-default/blob/master/pages/html.html
The text was updated successfully, but these errors were encountered: