Skip to content

Commit

Permalink
Merge pull request #2393 from jbms/fix-instant-svg
Browse files Browse the repository at this point in the history
Fix instant navigation when clicking on the logo button and logo is svg
  • Loading branch information
squidfunk committed Mar 7, 2021
2 parents f86d8b4 + 3ee51ac commit 815cb13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/assets/javascripts/integrations/instant/index.ts
Expand Up @@ -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 <svg> elements within <a> elements.
if (ev.target instanceof Element) {
const el = ev.target.closest("a")
if (el && !el.target && urls.includes(el.href)) {
ev.preventDefault()
Expand Down

0 comments on commit 815cb13

Please sign in to comment.