diff --git a/components/vc-select/Selector/Input.tsx b/components/vc-select/Selector/Input.tsx index a448d8ff7..6fef88368 100644 --- a/components/vc-select/Selector/Input.tsx +++ b/components/vc-select/Selector/Input.tsx @@ -35,7 +35,7 @@ interface InputProps { onCompositionend: EventHandlerNonNull; } -const Input = defineComponent({ +const Input = defineComponent({ name: 'Input', inheritAttrs: false, setup(props) { @@ -50,6 +50,7 @@ const Input = defineComponent({ }); } return { + blurTimeout: null, VCSelectContainerEvent: inject('VCSelectContainerEvent'), }; }, @@ -141,10 +142,13 @@ const Input = defineComponent({ }, onPaste, onFocus: (...args: any[]) => { + clearTimeout(this.blurTimeout); this.VCSelectContainerEvent?.focus(args[0]); }, onBlur: (...args: any[]) => { - this.VCSelectContainerEvent?.blur(args[0]); + this.blurTimeout = setTimeout(() => { + this.VCSelectContainerEvent?.blur(args[0]); + }, 200); }, }, inputNode.type === 'textarea' ? {} : { type: 'search' },