Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

fix: Hashes in links do not properly anchor to items in the page #70

Merged
merged 2 commits into from
Oct 26, 2019

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Oct 26, 2019

React Router does not scroll to an anchor when a link in a page gets clicked. I have applied this fix to resolve the issue: remix-run/react-router#394 (comment).

I also fixed that the docs re download data when search parameters or the hash in the location changes. It now only downloads data when the path changes. This means that there are now a lot less unnecessary reloads.

There is currently still an issue with anchoring when first navigating to a page (eg. going to https://deno.land/std/bytes/mod.ts?doc#findIndex won't actually anchor to findIndex as this element is not there on first load - because of client side rendering). This PR doesn't change this behavior. To fix this we need to add some code that manually scrolls to a certain tag after the content has been loaded. This might become somewhat messy, so Ill tackle that in a separate PR so we can discuss exactly how we want to do this.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants