quirkey/sammy

Relative route links in IE10 creates incorrect url

Opened this issue · 0 comments

When you have anchor elements where the href is relative, ie. '#/form1', and follow the link to the route the address in the address is incorrect in IE10. This is because pathname for anchor element is an empty string in IE10 if the link is relative with hash.

Try this is IE10 and other browsers to see the difference:

var anchor = document.createElement('a');
anchor.href = '#/design';
alert("'" + anchor.pathname + "'");

I added a small fix in Sammy.DefaultLocationProxy.fullPath that seems to work:

return [location_obj.pathname || window.location.pathname, location_obj.search, hash].join('');