router: Back button is broken in iOS since 1.5.0
Since the latest update that introduced the very useful isNavigating*
flags the back button is broken in iOS and seems to always take the user back to the home page.
To reproduce simply set up an Aurelia CLI app with at least 3 routes, then navigate from home, to route 2 to route 3 then hit the back button and you’ll end up on home - not route 2.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 49 (32 by maintainers)
https://github.com/aurelia/history-browser/releases/tag/1.1.1
@EisenbergEffect, @davismj already merged the PR 😃
I can confirm that the PR fixes my issues, with navigating back on Safari in macOS, as well. Looking forward to this being merged and released!
@huochunpeng and I are working on it. I’ll keep everyone posted here.
I’m the one that added the use of the state object and as far as I interpreted https://www.w3.org/TR/html50/browsers.html#state-object it’s intended to support the kind of usage implemented. There might be something wrong with the implementation, though (especially since https://caniuse.com/#search=replaceState says it shold be okay to use), and @davismj might have found the culprit. I might be able to take a look at this during the weekend, but I don’t have iOS around so if someone could then help out with testing that’d be great.
This bug does occur when using hash change. I noticed that back actually removes the hash from the url. Normally a link to a route of ‘’ would normal change the browser address to /#/, but when pressing back the url changes to /
I heard mention on github of a feature that would prevent the back navigation from browsing to a previous site (different host). Did that get implemented in 1.5?
@davismj - I was going to take a look at the router code but I couldn’t figure out why there are type definitions in the .js files. VS Code shows syntax errors all over! Is there an extension to make this work? Is there a document on the IDE setup for contributing to Aurelia? I couldn’t find anything.
LOL That’s what I get for being in a rush and not reading everything carefully! We’ll get it out this weekend.
@EisenbergEffect can be pulled in, see PR comments
Awesome work guys!
@davismj, to be honest, you might be the only one left using hash instead of push. 😃
@jimwards17 #528 was reported before 1.5.0 released afaik.
(That blush looked way too happy. It’s supposed to be a sad and embarassed blush, guys.)
If there’s anything I can help you test just let me know and I’ll do my best!