Skip to content

Commit 49f0ea4

Browse files
authored
Merge pull request #1234 from Patternslib/fix-nav
fix(pat-navigation): Fix case where no click anchor could be found.
2 parents 97524d3 + fcb349f commit 49f0ea4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pat/navigation/navigation.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Pattern extends BasePattern {
7474
// might be a child of the link, e.g. a span wrapped within an
7575
// anchor.
7676
const target = ev.target.closest("a");
77-
if (target.matches(":not(.pat-inject)")) {
77+
if (target?.matches(":not(.pat-inject)")) {
7878

7979
// Remove all set current classes
8080
this.clear_items();

0 commit comments

Comments
 (0)