Deep Linking Scroll
DavieReid opened this issue · comments
When you navigate to a section on a page and that page is using the Table of Contents (TOC) component the following happens:
Actual
- the page is briefly at the section linked
- the page scrolls to the top
- first section in the TOC is highlighted
- you are now lost and need to scroll back down the page to find the linked section (if you even know what it is)
Expected
- The linked section is highlighted in the TOC
- The linked section is in view (at the top of the page if the page is long enough to do so)
Is this still an issue? I can't recreate it
The scolling to the top issue doesnt seem to be there anymore but its still not great.
Try this link --> https://mosaic-mosaic-dev-team.vercel.app/mosaic/author/refs#existing-refs
are you at the Existing Refs section?
Okay I had a look at this and couldn't figure it out. It loads on the correct section and then scrolls to some other part, but there aren't any instances of window.scroll in our code that could be causing it.
if you go to the page (https://mosaic-mosaic-dev-team.vercel.app/mosaic/author/refs) and scroll all the way to the bottom while observing the TOC, you should see existing refs is a heading that never gets highlighted. Maybe that's the root cause...