From db4037aee32463feec2fbf8b7b5ddabd6da4edc2 Mon Sep 17 00:00:00 2001 From: Chris Fulljames Date: Sun, 23 Feb 2025 09:37:10 -0500 Subject: [PATCH] Fix bug where confirm dialogs had no effect --- static/nav.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/static/nav.js b/static/nav.js index 78840dd..101e3e5 100644 --- a/static/nav.js +++ b/static/nav.js @@ -36,6 +36,9 @@ document.addEventListener("DOMContentLoaded", (e) => { }); function onLinkClick(event) { + if (event.defaultPrevented) { + return; + } var targetUrl = new URL(event.currentTarget.href); if (urlIsOnSameSite(targetUrl)) { event.preventDefault(); @@ -45,6 +48,9 @@ function onLinkClick(event) { } function onFormSubmit(event) { + if (event.defaultPrevented) { + return; + } var targetUrl = new URL(event.target.action); if (urlIsOnSameSite(targetUrl)) { event.preventDefault(); -- 2.39.5