Skip to content

Commit

Permalink
fix(reset): only reset menu options that exist #161
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-capsule42 committed Feb 1, 2023
1 parent 87b062d commit 587e739
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/auro-menu.js
Expand Up @@ -137,11 +137,13 @@ class AuroMenu extends LitElement {
*/
resetOptionsStates() {
this.optionSelected = undefined;
this.items.forEach((item) => {
item.classList.remove('active');
item.removeAttribute('selected');
item.removeAttribute('aria-selected');
});
if (this.items) {
this.items.forEach((item) => {
item.classList.remove('active');
item.removeAttribute('selected');
item.removeAttribute('aria-selected');
});
}
}

/**
Expand Down

0 comments on commit 587e739

Please sign in to comment.