prevent default when navigating to current location

This commit is contained in:
Rich Harris
2017-12-16 10:59:46 -05:00
parent b3b5d9f352
commit dccd3cdeb0

View File

@@ -108,7 +108,10 @@ const app = {
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
const href = svg ? a.href.baseVal : a.href;
if (href === window.location.href) return;
if (href === window.location.href) {
event.preventDefault();
return;
}
// Ignore if tag has
// 1. 'download' attribute