Commit 7e3fc4a522c4629b5350b36e888a2304c23d8074
1 parent
16fc6361
close the menu if no option is focused on Enter
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
src/components/select/select.vue
@@ -494,7 +494,8 @@ | @@ -494,7 +494,8 @@ | ||
494 | this.navigateOptions(1); | 494 | this.navigateOptions(1); |
495 | } | 495 | } |
496 | // enter | 496 | // enter |
497 | - if (e.key === 'Enter' && this.focusIndex > -1) { | 497 | + if (e.key === 'Enter') { |
498 | + if (this.focusIndex === -1) return this.hideMenu(); | ||
498 | const optionComponent = this.flatOptions[this.focusIndex]; | 499 | const optionComponent = this.flatOptions[this.focusIndex]; |
499 | const option = this.getOptionData(optionComponent.componentOptions.propsData.value); | 500 | const option = this.getOptionData(optionComponent.componentOptions.propsData.value); |
500 | this.onOptionClick(option); | 501 | this.onOptionClick(option); |