Skip to content
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

Breaks when <base> head element is used #47

Open
tchock opened this issue Jul 5, 2018 · 2 comments · May be fixed by #50
Open

Breaks when <base> head element is used #47

tchock opened this issue Jul 5, 2018 · 2 comments · May be fixed by #50

Comments

@tchock
Copy link

tchock commented Jul 5, 2018

What I do:
I am using <base href="/"> in the <head> of the html file and scrolling through the sections.

What I see:
it won't update the hash relative to the path but will use the base path to append the hash to.
This then goes to a complete new site because the router reacts to the route change.

What I expect:
The route should stay the same, but only the hash should change.

Possible solution:
In https://github.com/gabergg/react-scrollable-anchor/blob/master/src/utils/hash.js it should also use the rest of the path to build the complete URL instead of just updating the URL.

@tchock tchock linked a pull request Jul 5, 2018 that will close this issue
@definder
Copy link

I disagree with your solution. It's enough to call the method of Manager.handleHashChange in react-router changes moment. For example, add call that function to listen route history, history.listen(() => Manager.handleHashChange())

@GabrielDelepine
Copy link

@tchock Thanks, it's clearly an unexpected behaviour;

@definder Everybody is not supposed to use react-router.

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

Successfully merging a pull request may close this issue.

3 participants