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()