From 799c42d337c715595fbd2617d09a5d03b1c5b6f1 Mon Sep 17 00:00:00 2001 From: hetech Date: Wed, 27 Mar 2019 18:28:18 +0800 Subject: [PATCH] Select: not toggle dropdown when filtering (#12210) --- packages/select/src/select.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/select/src/select.vue b/packages/select/src/select.vue index e35db542e..fb683c8b2 100644 --- a/packages/select/src/select.vue +++ b/packages/select/src/select.vue @@ -50,7 +50,6 @@ :autocomplete="autoComplete || autocomplete" @focus="handleFocus" @blur="softFocus = false" - @click.stop @keyup="managePlaceholder" @keydown="resetInputState" @keydown.down.prevent="navigateOptions('next')" @@ -58,6 +57,7 @@ @keydown.enter.prevent="selectOption" @keydown.esc.stop.prevent="visible = false" @keydown.delete="deletePrevTag" + @keydown.tab="visible = false" @compositionstart="handleComposition" @compositionupdate="handleComposition" @compositionend="handleComposition" @@ -80,6 +80,7 @@ :readonly="readonly" :validate-event="false" :class="{ 'is-focus': visible }" + :tabindex="(multiple && filterable) ? '-1' : null" @focus="handleFocus" @blur="handleBlur" @keyup.native="debouncedOnInputChange" @@ -380,6 +381,7 @@ this.previousQuery = null; this.selectedLabel = ''; this.inputLength = 20; + this.menuVisibleOnFocus = false; this.resetHoverIndex(); this.$nextTick(() => { if (this.$refs.input && @@ -575,7 +577,9 @@ if (!this.softFocus) { if (this.automaticDropdown || this.filterable) { this.visible = true; - this.menuVisibleOnFocus = true; + if (this.filterable) { + this.menuVisibleOnFocus = true; + } } this.$emit('focus', event); } else {