Open DanielMiddleton opened 9 years ago
You have saved my life, bro! This needs to be implemented asap! +1
This needs to be fixed! In addition, it seems that both the click handler and popstate handlers are firing for hash-only (href="#hash"
) routes in IE11, causing buggy behavior where the path seems to be reset.
Are you saying you have a route like:
page('/about#me', function(){
// do stuff here
});
And this is not triggered because we don't listen for the hashchange?
Just a small update, I looked into this yesterday and adding that event listener broke some other tests. I didn't have a chance to look into why it breaks those tests. My guess is that since we already listening to anchor click
events, we might get double events when also listening to hashchange
. This is just a guess though. I'm writing this as a note to myself when I get the chance to look at this issue again.
I ran into a bug this afternoon where some of my routes weren't working in IE (10 and 11). We're using hashes for certain in-page routes (not hashbangs though), to trigger loading certain overlays. The route would get populated but the content wouldn't be shown, because the onpopstate event was not fired, because it was only a hash change.
Attaching onpopstate to the hashchange event in page.start resolves my issue:
Is a particular reason this doesn't already exist, or something else that I should be doing instead?