mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-10 07:52:23 +03:00
fix(1735): use keypress event for space (#1736)
This commit is contained in:
@@ -574,8 +574,6 @@ export default {
|
||||
default: () => [
|
||||
// enter
|
||||
13,
|
||||
// space
|
||||
32,
|
||||
],
|
||||
},
|
||||
|
||||
@@ -773,6 +771,7 @@ export default {
|
||||
compositionstart: () => (this.isComposing = true),
|
||||
compositionend: () => (this.isComposing = false),
|
||||
keydown: this.onSearchKeyDown,
|
||||
keypress: this.onSearchKeyPress,
|
||||
blur: this.onSearchBlur,
|
||||
focus: this.onSearchFocus,
|
||||
input: (e) => (this.search = e.target.value),
|
||||
@@ -1358,6 +1357,17 @@ export default {
|
||||
return handlers[e.keyCode](e)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* @todo: Probably want to add a mapKeyPress method just like we have for keydown.
|
||||
* @param {KeyboardEvent} e
|
||||
*/
|
||||
onSearchKeyPress(e) {
|
||||
if (!this.open && e.keyCode === 32) {
|
||||
e.preventDefault()
|
||||
this.open = true
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user