Only handle <space> when focus is on list
This commit is contained in:
parent
917b862786
commit
a724c53837
1 changed files with 1 additions and 1 deletions
|
@ -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