Issues in IE10/IE11 when using favorites/bookmarks twice or entering an url manually #9143
Description
Hi!
After digging around a lot in the AngularJS-code and also comparing behavior with Backbone etc. in case of routings combined with using bookmarks/favorites in IE10/IE11, there is one thing that leads to a very bad behavior in the IE-browsers together with the History API / event listener structure.
The problem itself is also pretty well described here angular-ui/ui-router#1241
For IE9, the problem is gone since 1.2.24 as the "sync" handling was improved #6976
Unfortunately, for IE10/IE11, the problem still resists. I could drill this down to the following preventDefault event handling:
https://github.com/angular/angular.js/blob/v1.2.x/src/ng/location.js#L705
As soon as this line is removed / commented out, IE10/IE11 behave correctly. Don't ask me why, but this is pretty strange. I wasn't able to oversee the consequences within all browsers except that event bubbling is a bit more and it might lead to a bit of inconsistent behavior.
Need general example code?
Just take these:
AngularJS - http://angular-route-segment.com/src/example/#/section1/2
BackboneJS powered working case - http://demos.9lessons.info/backbone/#block/four/4
- Bookmark one of the states
- navigate away
- click on the bookmark
- navigate away
- click again on the bookmark -> boom
It works if the page is initially called, but not if the bookmarked state was already browsed / called via bookmark. Indications that the event bubbling / intercepting behaves different can be found at http://stackoverflow.com/questions/23349191/event-preventdefault-is-not-working-in-ie-11-for-custom-events and also some other places that IE might behave differently.
Another result of the tests is the fact that the hashchange listener will not get fired if the preventDefault is enabled and that the order of events still seems to be a bit different compared with the other browsers.