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

Change location.hash *before* scrolling. #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Change location.hash *before* scrolling. #123

wants to merge 2 commits into from

Conversation

sscherfke
Copy link

You have to update location.hash before scrolling or the browser history will break and not jump to the correct positions in the document.

You have to update `location.hash` before scrolling or the browser history will break and not jump to the correct positions in the document.
Changing `location.hash` before scrolling fixes the browser history but breaks smooth scrolling. In order to fix both, we need to add a temporary fake link element.
@typeofweb
Copy link

This is not true. What browsers have you tested?

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.

None yet

2 participants