You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using anchor links like /help#faqs, but the page is not scrolled to the specified id on the initial load - shouldUpdateScroll is not called. If the website was loaded - clicking the link works as expected and page scrolls. One possible solution is to add componentDidMount to https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-react-router-scroll/src/ScrollBehaviorContext.js and call this.scrollBehavior.updateScroll but it is not clear what to use for prevRouterProps
Description
I'm using anchor links like
/help#faqs
, but the page is not scrolled to the specified id on the initial load -shouldUpdateScroll
is not called. If the website was loaded - clicking the link works as expected and page scrolls. One possible solution is to addcomponentDidMount
to https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-react-router-scroll/src/ScrollBehaviorContext.js and callthis.scrollBehavior.updateScroll
but it is not clear what to use forprevRouterProps
Steps to reproduce
add export to your
gatsby-browser.js
update the page and check that no message is present
Expected result
shouldUpdateScroll
is called and the anchor link scrolls the pageActual result
shouldUpdateScroll
is called only after clicking a link if the app is loaded alreadyEnvironment
The text was updated successfully, but these errors were encountered: