Skip to content

Commit

Permalink
fix(select): multiselect option is toggled when menu is closed (fix #4)
Browse files Browse the repository at this point in the history
  • Loading branch information
balsigergil committed Jan 26, 2024
1 parent 80d2d44 commit fca4f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/select/Select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class Select extends HTMLElement {
}
if (e.key === "Enter") {
e.preventDefault();
if (this.#focusedItemIndex !== null) {
if (this.#focusedItemIndex !== null && this.isMenuOpen) {
this.#setSelected(this.#focusedItemIndex);
}
this.closeMenu();
Expand Down

0 comments on commit fca4f34

Please sign in to comment.