Commit 323494917f0af833641d28cdfcdd1718ccfab240
1 parent
35c70b95
fix #5155 close #5158
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
src/components/select/select-head.vue
... | ... | @@ -22,7 +22,7 @@ |
22 | 22 | @keydown="resetInputState" |
23 | 23 | @keydown.delete="handleInputDelete" |
24 | 24 | @focus="onInputFocus" |
25 | - @blur="onInputFocus" | |
25 | + @blur="onInputBlur" | |
26 | 26 | |
27 | 27 | ref="input"> |
28 | 28 | <Icon type="ios-close-circle" :class="[prefixCls + '-arrow']" v-if="resetSelect" @click.native.stop="onClear"></Icon> |
... | ... | @@ -146,8 +146,12 @@ |
146 | 146 | } |
147 | 147 | }, |
148 | 148 | methods: { |
149 | - onInputFocus(e){ | |
150 | - this.$emit(e.type === 'focus' ? 'on-input-focus' : 'on-input-blur'); | |
149 | + onInputFocus(){ | |
150 | + this.$emit('on-input-focus'); | |
151 | + }, | |
152 | + onInputBlur () { | |
153 | + if (!this.values.length) this.query = ''; // #5155 | |
154 | + this.$emit('on-input-blur'); | |
151 | 155 | }, |
152 | 156 | removeTag (value) { |
153 | 157 | if (this.disabled) return false; | ... | ... |