Skip to content

Commit

Permalink
docs: if target is a link dont preventDefault
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroedin committed Jun 7, 2024
1 parent 89bdbea commit 1fdd4c2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/assets/javascript/elements/uxdot-sidenav.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,10 @@ class UxdotSideNavDropdown extends LitElement {
}

async #onClick(event) {
const { target } = event;
if (target instanceof HTMLAnchorElement) {
return;
}
event.preventDefault();
this.expanded = !this.expanded;
this.querySelector('details').toggleAttribute('open', this.expanded);
Expand Down

0 comments on commit 1fdd4c2

Please sign in to comment.