From fca4f347b87e493ea444a5a8eba0418a613a3a55 Mon Sep 17 00:00:00 2001 From: Gil Balsiger Date: Fri, 26 Jan 2024 22:37:49 +0100 Subject: [PATCH] fix(select): multiselect option is toggled when menu is closed (fix #4) --- src/select/Select.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/select/Select.ts b/src/select/Select.ts index e6bd946..62eedbe 100644 --- a/src/select/Select.ts +++ b/src/select/Select.ts @@ -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();