sheet-router
sheet-router copied to clipboard
BUG: href.js doesn't trigger callback in IE
Clicking on an anchor element in IE doesn't trigger the callback passed to href to be called. I believe this is because the logic for finding the anchor node containing the href doesn't work properly in IE, specifically line 24, which checks if the found anchor points to the same host as the current window, because the host
property of anchor elements is not available on IE (nor Safari, for that matter).
Uh oh, that's no good. Any suggestions on how to fix this?
On Sat, Feb 25, 2017, 23:01 Owen Derby [email protected] wrote:
Clicking on an anchor element in IE doesn't trigger the callback passed to href to be called. I believe this is because the logic for finding the anchor node containing the href doesn't work properly in IE, specifically line 24 https://github.com/yoshuawuyts/sheet-router/blob/master/href.js#L24, which checks if the found anchor points to the same host as the current window, because the host property of anchor elements is not available on IE https://developer.mozilla.org/en-US/docs/Web/API/HTMLHyperlinkElementUtils/host (nor Safari, for that matter).
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/yoshuawuyts/sheet-router/issues/82, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWlenT__bIzT39FLOqFiQipD-WPtBpXks5rgKS2gaJpZM4MMJ0s .
I'd be surprised if someone hasn't already written the logic to simulate/polyfill the host property - afterall, it should be deterministic given the href, right? I'm sure there are some corner cases, but you should be able to just pull in the bits you need, if you don't want the bloat of adding a whole library to do it.