close the menu if no option is focused on Enter
This commit is contained in:
parent
16fc63614f
commit
7e3fc4a522
1 changed files with 2 additions and 1 deletions
|
@ -494,7 +494,8 @@
|
||||||
this.navigateOptions(1);
|
this.navigateOptions(1);
|
||||||
}
|
}
|
||||||
// enter
|
// enter
|
||||||
if (e.key === 'Enter' && this.focusIndex > -1) {
|
if (e.key === 'Enter') {
|
||||||
|
if (this.focusIndex === -1) return this.hideMenu();
|
||||||
const optionComponent = this.flatOptions[this.focusIndex];
|
const optionComponent = this.flatOptions[this.focusIndex];
|
||||||
const option = this.getOptionData(optionComponent.componentOptions.propsData.value);
|
const option = this.getOptionData(optionComponent.componentOptions.propsData.value);
|
||||||
this.onOptionClick(option);
|
this.onOptionClick(option);
|
||||||
|
|
Loading…
Add table
Reference in a new issue