From 323494917f0af833641d28cdfcdd1718ccfab240 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Mon, 7 Jan 2019 11:41:56 +0800 Subject: [PATCH] fix #5155 close #5158 --- src/components/select/select-head.vue | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/select/select-head.vue b/src/components/select/select-head.vue index 92d9d74..9bb8e42 100644 --- a/src/components/select/select-head.vue +++ b/src/components/select/select-head.vue @@ -22,7 +22,7 @@ @keydown="resetInputState" @keydown.delete="handleInputDelete" @focus="onInputFocus" - @blur="onInputFocus" + @blur="onInputBlur" ref="input"> @@ -146,8 +146,12 @@ } }, methods: { - onInputFocus(e){ - this.$emit(e.type === 'focus' ? 'on-input-focus' : 'on-input-blur'); + onInputFocus(){ + this.$emit('on-input-focus'); + }, + onInputBlur () { + if (!this.values.length) this.query = ''; // #5155 + this.$emit('on-input-blur'); }, removeTag (value) { if (this.disabled) return false; -- libgit2 0.21.4