mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-15 20:34:44 +00:00
prevent default when navigating to current location
This commit is contained in:
@@ -108,7 +108,10 @@ const app = {
|
|||||||
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
|
const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString';
|
||||||
const href = svg ? a.href.baseVal : a.href;
|
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
|
// Ignore if tag has
|
||||||
// 1. 'download' attribute
|
// 1. 'download' attribute
|
||||||
|
|||||||
Reference in New Issue
Block a user