File tree 1 file changed +6
-2
lines changed
components/vc-select/Selector
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ interface InputProps {
35
35
onCompositionend : EventHandlerNonNull ;
36
36
}
37
37
38
- const Input = defineComponent < InputProps , { VCSelectContainerEvent : any } > ( {
38
+ const Input = defineComponent < InputProps , { VCSelectContainerEvent : any ; blurTimeout : any } > ( {
39
39
name : 'Input' ,
40
40
inheritAttrs : false ,
41
41
setup ( props ) {
@@ -50,6 +50,7 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any }>({
50
50
} ) ;
51
51
}
52
52
return {
53
+ blurTimeout : null ,
53
54
VCSelectContainerEvent : inject ( 'VCSelectContainerEvent' ) ,
54
55
} ;
55
56
} ,
@@ -141,10 +142,13 @@ const Input = defineComponent<InputProps, { VCSelectContainerEvent: any }>({
141
142
} ,
142
143
onPaste,
143
144
onFocus : ( ...args : any [ ] ) => {
145
+ clearTimeout ( this . blurTimeout ) ;
144
146
this . VCSelectContainerEvent ?. focus ( args [ 0 ] ) ;
145
147
} ,
146
148
onBlur : ( ...args : any [ ] ) => {
147
- this . VCSelectContainerEvent ?. blur ( args [ 0 ] ) ;
149
+ this . blurTimeout = setTimeout ( ( ) => {
150
+ this . VCSelectContainerEvent ?. blur ( args [ 0 ] ) ;
151
+ } , 200 ) ;
148
152
} ,
149
153
} ,
150
154
inputNode . type === 'textarea' ? { } : { type : 'search' } ,
You can’t perform that action at this time.
0 commit comments