From 7e3fc4a522c4629b5350b36e888a2304c23d8074 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Tue, 8 May 2018 11:38:04 +0200 Subject: [PATCH] close the menu if no option is focused on Enter --- src/components/select/select.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 013c1a53..6ca51b3d 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -494,7 +494,8 @@ this.navigateOptions(1); } // 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 option = this.getOptionData(optionComponent.componentOptions.propsData.value); this.onOptionClick(option);