From 67fe570f6d34e9fb29c835b027f3f7735e13c625 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 15 Dec 2017 18:26:55 -0500 Subject: [PATCH] dont try to prevent event where none exists --- runtime/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/runtime/app.js b/runtime/app.js index 223cb1d..b90f9a7 100644 --- a/runtime/app.js +++ b/runtime/app.js @@ -77,7 +77,6 @@ const app = { scroll_history[cid] = { x: 0, y: 0 }; history.pushState({ id }, '', url.href); - event.preventDefault(); } selected.route.load().then(mod => { @@ -121,7 +120,9 @@ const app = { const scroll = scroll_state(); - navigate(new URL(a.href), null); + if (navigate(new URL(a.href), null)) { + event.preventDefault(); + } }); function preload(event) {