[Gekidou MM-47486] Clear the search input after selecting a user (#6683)
This commit is contained in:
parent
b90eaefcc0
commit
6b2d8ceff3
1 changed files with 3 additions and 3 deletions
|
|
@ -90,7 +90,7 @@ const Search = forwardRef<SearchRef, SearchProps>((props: SearchProps, ref) => {
|
|||
const onClear = useCallback(() => {
|
||||
setValue('');
|
||||
props.onClear?.();
|
||||
}, []);
|
||||
}, [props.onClear]);
|
||||
|
||||
const onChangeText = useCallback((text: string) => {
|
||||
setValue(text);
|
||||
|
|
@ -105,8 +105,8 @@ const Search = forwardRef<SearchRef, SearchProps>((props: SearchProps, ref) => {
|
|||
}), [theme]);
|
||||
|
||||
useEffect(() => {
|
||||
setValue(props.defaultValue || value || '');
|
||||
}, [props.defaultValue]);
|
||||
setValue(props.defaultValue || props.value || '');
|
||||
}, [props.defaultValue, props.value]);
|
||||
|
||||
const clearIcon = (
|
||||
<CompassIcon
|
||||
|
|
|
|||
Loading…
Reference in a new issue