Only handle <space> when focus is on list
This commit is contained in:
parent
917b862786
commit
aa93cee9fa
2 changed files with 2 additions and 2 deletions
|
@ -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/"
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue