File tree 2 files changed +6
-19
lines changed
2 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -122,20 +122,10 @@ export function FormExamples() {
122
122
< FormGroupAutocomplete
123
123
name = "autocompleteField3"
124
124
label = "Autocomplete with item template"
125
- options = { [
126
- {
127
- value : 1 ,
128
- label : '1234' ,
129
- } ,
130
- {
131
- value : 2 ,
132
- label : '2345' ,
133
- } ,
134
- {
135
- value : 3 ,
136
- label : '3456' ,
137
- } ,
138
- ] }
125
+ options = { Array . from ( { length : 10 } ) . map ( ( _ , index ) => ( {
126
+ value : index + 1 ,
127
+ label : `${ index + 1 } ${ index + 2 } ${ index + 3 } ${ index + 4 } ` ,
128
+ } ) ) }
139
129
placeholder = "Type some numbers"
140
130
template = { ( option ) => (
141
131
< >
Original file line number Diff line number Diff line change @@ -60,10 +60,6 @@ export function FormAutocomplete({
60
60
}
61
61
} }
62
62
onBlur = { ( ) => {
63
- if ( ! value ) {
64
- setSearchValue ( '' ) ;
65
- }
66
-
67
63
if ( ignoreBlur ) {
68
64
searchInputRef . current . focus ( ) ;
69
65
} else {
@@ -110,9 +106,10 @@ export function FormAutocomplete({
110
106
setTimeout ( ( ) => {
111
107
setFocus ( false ) ;
112
108
close ( ) ;
113
- } , 100 ) ;
109
+ } , 60 ) ;
114
110
} }
115
111
template = { template }
112
+ onClick = { ( e ) => e . stopPropation ( ) }
116
113
onTouchStart = { ( ) => setIgnoreBlur ( true ) }
117
114
onMouseEnter = { ( ) => setIgnoreBlur ( true ) }
118
115
onMouseLeave = { ( ) => setIgnoreBlur ( false ) }
You can’t perform that action at this time.
0 commit comments