File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed
Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,6 @@ export const SearchBar: FunctionComponent<
7575 finalValue : '' ,
7676 } )
7777
78- useEffect ( ( ) => {
79- setValue ( defaultValue )
80- } , [ defaultValue ] )
81-
8278 const forceFocus = ( ) => {
8379 const searchSelf : HTMLInputElement | null = searchInputRef . current
8480 searchSelf && searchSelf . focus ( )
@@ -137,7 +133,7 @@ export const SearchBar: FunctionComponent<
137133 < View
138134 key = { `def-${ index } ` }
139135 className = "nut-searchbar-value"
140- onClick = { ( ) => onItemClick ( item ) }
136+ onClick = { ( ) => onItemClick ?. ( item ) }
141137 >
142138 { item }
143139 < Close />
Original file line number Diff line number Diff line change @@ -68,10 +68,6 @@ export const SearchBar: FunctionComponent<
6868 finalValue : '' ,
6969 } )
7070
71- useEffect ( ( ) => {
72- setValue ( defaultValue )
73- } , [ defaultValue ] )
74-
7571 const forceFocus = ( ) => {
7672 const searchSelf : HTMLInputElement | null = searchInputRef . current
7773 searchSelf && searchSelf . focus ( )
@@ -125,7 +121,7 @@ export const SearchBar: FunctionComponent<
125121 < div
126122 key = { `def-${ index } ` }
127123 className = "nut-searchbar-value"
128- onClick = { ( ) => onItemClick ( item ) }
124+ onClick = { ( ) => onItemClick ?. ( item ) }
129125 >
130126 { item }
131127 < Close />
You can’t perform that action at this time.
0 commit comments