forked from Ivasoft/mattermost-mobile
[Gekidou MM-47486] Clear the search input after selecting a user (#6683)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user