-
Notifications
You must be signed in to change notification settings - Fork 689
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
Listen hashchange
if popstate = false
#542
base: master
Are you sure you want to change the base?
Conversation
Seems we should add an event listener to `hashchange` if `popstate` option equals false and `hashbang` option equals true. In this case, right now back navigation via `history.back()` not working.
Seems the previous condition should be left completely. Only additional behavior needed.
@matthewp Any news here? Is this patch reasonable? |
It's hard to keep all of this in my head correctly. We've had a lot of modification of this part of the code. I'm a little bit afraid that we're playing bug whack-a-mole. We fix one thing but break something else. To prevent that going forward I feel we really need tests for each PR. So if you can add a test for this case then I think it's good to go. |
@matthewp I believe it's a very obvious case to be tested. Seems we should trigger page.start({
popstate: false,
hashbang: true,
}); Because we've only two places where and if(this._hashbang && hasWindow && !hasHistory) So, in a case when we've history and don't want to popstate, It's very bad because if in this case, we'll press the browser back button, the router won't be informed about location changed. |
@matthewp Any thoughts? |
Not on your last comment, no, sorry. But, what needs to happen is we need a test that verifies that a hashchange listener is added when |
Seems we should add an event listener to
hashchange
ifpopstate
option equals false andhashbang
option equals true. In this case, right now back navigation viahistory.back()
not working.