Skip to content

Prevent hashes from affecting browser history #312

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

Open
BradRyan opened this issue Mar 2, 2018 · 3 comments
Open

Prevent hashes from affecting browser history #312

BradRyan opened this issue Mar 2, 2018 · 3 comments

Comments

@BradRyan
Copy link

BradRyan commented Mar 2, 2018

It looks like the package is using history.pushState instead of history.replaceState.

It would be nice if I could scroll around with hash spy enabled and not have it impact how many times I have to hit the browser back button to navigate to the previous page.

Reference: https://stackoverflow.com/questions/2305069/can-you-use-hash-navigation-without-affecting-history

@bambielli
Copy link

I have a use case for this as well, however I'm not sure that replacing pushState with replaceState is the best solution... maybe making push vs replace an additional prop you can pass? Or making the hashSpy prop a configuration object instead of just a boolean?

It would be nice to have the option to configure this behavior.

@fisshy
Copy link
Owner

fisshy commented Jun 6, 2018

You are right, feel free to make a PR solving this issue :)

@sugarp
Copy link

sugarp commented Oct 24, 2019

Hey guys, is there any update with this? The PR has been open a some time and I would love to use it.
#359

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

No branches or pull requests

4 participants