From dccd3cdeb08896ce5ccb4d2e6f5d7096cc787001 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 16 Dec 2017 10:59:46 -0500 Subject: [PATCH] prevent default when navigating to current location --- runtime/app.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/app.js b/runtime/app.js index d35be2d..3e7a876 100644 --- a/runtime/app.js +++ b/runtime/app.js @@ -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