Prevent initial space when opening with space bar
This commit is contained in:
parent
df795fe894
commit
3f7d435fff
2 changed files with 3 additions and 2 deletions
|
@ -3,6 +3,6 @@
|
|||
"browser": "src/BetterSelect.js",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"url": "https://darkwiiplayer.github.io/BetterSelect/"
|
||||
}
|
||||
|
|
|
@ -203,6 +203,8 @@ export class BetterSelect extends HTMLElement {
|
|||
} else {
|
||||
if (key == " ") {
|
||||
this.open()
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
} else if (key == "Escape") {
|
||||
this.keyboardSearchBuffer = ""
|
||||
event.preventDefault()
|
||||
|
@ -236,7 +238,6 @@ export class BetterSelect extends HTMLElement {
|
|||
|
||||
const timeout = 1000 * (Number(this.getAttribute("search-timeout")) || 1)
|
||||
const ref = setTimeout(()=> {
|
||||
console.warn("Clearing buffer: " + this.keyboardSearchBuffer)
|
||||
this.keyboardSearchBuffer = ""
|
||||
}, timeout)
|
||||
this.searchTimeout.signal.addEventListener("abort", () => {
|
||||
|
|
Loading…
Reference in a new issue