-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fix error when user clicks a link within 500ms #279
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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