We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f96e225 + 8578b1b commit 881346dCopy full SHA for 881346d
src/pat/navigation/navigation.js
@@ -70,11 +70,16 @@ class Pattern extends BasePattern {
70
"click",
71
"pat_navigation_click_handler",
72
(ev) => {
73
- if (ev.target.matches("a:not(.pat-inject)")) {
+ // Get the click target's anchor element. The click target
74
+ // might be a child of the link, e.g. a span wrapped within an
75
+ // anchor.
76
+ const target = ev.target.closest("a");
77
+ if (target.matches(":not(.pat-inject)")) {
78
+
79
// Remove all set current classes
80
this.clear_items();
81
// Mark the current item
- this.mark_current(ev.target);
82
+ this.mark_current(target);
83
84
if (
85
!utils.is_option_truthy(this.options["scroll-trigger-selector"])
0 commit comments