From 3ee51acca2afa81abc786d3c1029f77d3eb5db35 Mon Sep 17 00:00:00 2001 From: Jeremy Maitin-Shepard Date: Fri, 5 Mar 2021 17:14:41 -0800 Subject: [PATCH] Fix instant navigation when clicking on the logo button and logo is svg --- src/assets/javascripts/integrations/instant/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/integrations/instant/index.ts b/src/assets/javascripts/integrations/instant/index.ts index f37adbc40..e880fa5ae 100644 --- a/src/assets/javascripts/integrations/instant/index.ts +++ b/src/assets/javascripts/integrations/instant/index.ts @@ -180,7 +180,9 @@ export function setupInstantLoading( .pipe( filter(ev => !ev.metaKey && !ev.ctrlKey), switchMap(ev => { - if (ev.target instanceof HTMLElement) { + // Check for `Element` rather than `HTMLElement` to also + // handle elements within elements. + if (ev.target instanceof Element) { const el = ev.target.closest("a") if (el && !el.target && urls.includes(el.href)) { ev.preventDefault()