Listen hashchange if popstate = false#542
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
hashchangeifpopstateoption equals false andhashbangoption equals true. In this case, right now back navigation viahistory.back()not working.