diff --git a/packages/common/Select/src/BaseSelect.vue b/packages/common/Select/src/BaseSelect.vue index 8bd7a32ae..6ca7de48c 100644 --- a/packages/common/Select/src/BaseSelect.vue +++ b/packages/common/Select/src/BaseSelect.vue @@ -93,7 +93,6 @@ :readonly="!disabled && filterable ? false : 'readonly'" @input="handleSingleInputInput" @focus="handleSingleInputFocus" - @blur="handleSingleInputBlur" > @@ -373,6 +372,10 @@ export default { handleClickOutsideMenu (e) { if (!this.$refs.activator.contains(e.target) && !this.scrolling) { this.deactivate() + if (this.filterable && !this.multiple) { + this.pattern = '' + this.singleInputActive = false + } } }, closeMenu () { @@ -427,6 +430,10 @@ export default { this.$emit('input', newValue) this.emitChangeEvent(newValue) } else { + if (this.filterable && !this.multiple) { + this.pattern = '' + this.singleInputActive = false + } this.$emit('input', option.value) this.emitChangeEvent(option.value) this.closeMenu() @@ -520,13 +527,6 @@ export default { this.singleInputActive = true } }, - handleSingleInputBlur () { - // console.log('handleSingleInputBlur') - if (this.filterable && !this.multiple) { - this.pattern = '' - this.singleInputActive = false - } - }, handleSingleInputInput (e) { this.pattern = e.target.value if (this.onSearch) { diff --git a/packages/common/Select/src/SelectMenu.vue b/packages/common/Select/src/SelectMenu.vue index 015fe760a..9d84674cd 100644 --- a/packages/common/Select/src/SelectMenu.vue +++ b/packages/common/Select/src/SelectMenu.vue @@ -203,6 +203,7 @@ export default { if (selectElement) { selectElement.focus() } + console.log('handleOptionClick', option) this.toggleOption(option) }, handleMenuMouseLeave () {