Fix error when user clicks a link within 500ms#279
Fix error when user clicks a link within 500ms#279cmwelsh wants to merge 1 commit intoflatiron:masterfrom
Conversation
|
As a note this caused #227 for me on iOS but I work around that by tracking the last matched route & parameters combination... |
|
Can we get some eyes on this? |
|
I'm experiencing the side effect of the original "fix", which is the fact that if you call setRoute within 500ms, it causes an error. |
|
Can it be merged ? the tests are failing on missing npm packages, not real tests. |
|
+1 to get this fix merged into master, chrome has long since fixed this issue. |
|
+1. As long as there is no fix, someone has a workaround for this? |
|
We started bumping into this today. Can this get pulled in @jcrugzz? |
|
+1 please merge this. |
|
@3rd-Eden @bmeck @dscape @gangstead @indexzero @jcrugzz @Swaagie Can we please get this merged? It's a one liner and is causing production issues for us, would love to not have to point to a fork. |
|
Well, there is a workaround and that's a function waiting for navigate: function (route) {
var isDirectorReady = callback => {
var interval;
if (window.onpopstate !== null) {
callback();
return;
}
interval = setInterval(function () {
if (window.onpopstate !== null) {
callback();
clearInterval(interval);
}
}, 100);
}
isDirectorReady(() => {
this._router.setRoute(...);
});
}So, I'm definitely +1 for merging this PR. |
| setTimeout(function() { | ||
| window.onpopstate = onchange; | ||
| }, 500); | ||
| window.onpopstate = onchange; |
There was a problem hiding this comment.
@cmwelsh could you please please review this?
|
@trevordmiller it seems like it :( |
This Chrome "bug fix" can be removed now per #233. Chrome 39 is now in production and the "fix" has a big drawback of throwing an error if the user clicks a link within 500ms of director initialization.
Closes #233