mithril.js: Route is not resolved on hash change in IE
Hello!
I found that in IE supportsPushState is true, but onpopstate will never be called. So links does not work.
Example here: https://jsfiddle.net/1bj54j8v/
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (16 by maintainers)
Commits related to this issue
- [router] Add a second parameter to m.route.prefix to toggle onhashchange-based routing explicitly fix #1734 — committed to pygy/mithril.js by pygy 6 years ago
@isiahmeadows Worse, I recently realised that
onhashchangewasn’t debounced as I thought it was due to a JSBin bug(https://github.com/jsbin/jsbin/issues/3078) (and not enough cross checking on my hand)…I’m afraid the fix for this will be breaking: https://github.com/pygy/mithril.js/commit/bd7230fc54c80695187ad94d8f987f3295e0dd3a#diff-08af55052ff6ecc22309ea97e4711428R101
This is impossible to implement for IE9 (and it has never been), but if we want the router to work identically in every env in hash mode, we can’t cheat with
replaceState()when the routed tree is mounted.This test would have passed in non-IE browsers…
There’s also https://github.com/pygy/mithril.js/commit/bd7230fc54c80695187ad94d8f987f3295e0dd3a#diff-08af55052ff6ecc22309ea97e4711428R799 that must be elucidated, it may be a
pushStateMockbug or a router bug.Edit: here’s the problem child in full:
Before this,
onhashchange-based routing wasn’t tested at all 😕