From aa93cee9fa305ed229aaf6cdbdffce6777c7104b Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Thu, 16 Jan 2025 15:33:06 +0100 Subject: [PATCH] Only handle when focus is on list --- package.json | 2 +- src/BetterSelect.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ebf5f4a..b75a340 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,6 @@ "browser": "src/BetterSelect.js", "type": "module", "license": "MIT", - "version": "1.2.1", + "version": "1.2.2", "url": "https://darkwiiplayer.github.io/BetterSelect/" } diff --git a/src/BetterSelect.js b/src/BetterSelect.js index 6400c85..9dbec02 100644 --- a/src/BetterSelect.js +++ b/src/BetterSelect.js @@ -191,7 +191,7 @@ export class BetterSelect extends HTMLElement { }) this.addEventListener("keydown", event => { - if (event.key == " " && !this.input.contains(this.shadowRoot.activeElement)) { + if (event.key == " " && this.list.contains(this.shadowRoot.activeElement)) { if (this.#internals.states.has("--open")) { this.close() } else {