From 6b2d8ceff36b262bf63078545bf82e019f0a8dc7 Mon Sep 17 00:00:00 2001 From: Jason Frerich Date: Thu, 20 Oct 2022 05:54:00 -0500 Subject: [PATCH] [Gekidou MM-47486] Clear the search input after selecting a user (#6683) --- app/components/search/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/search/index.tsx b/app/components/search/index.tsx index 29e2c47b52..24cfcab26f 100644 --- a/app/components/search/index.tsx +++ b/app/components/search/index.tsx @@ -90,7 +90,7 @@ const Search = forwardRef((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((props: SearchProps, ref) => { }), [theme]); useEffect(() => { - setValue(props.defaultValue || value || ''); - }, [props.defaultValue]); + setValue(props.defaultValue || props.value || ''); + }, [props.defaultValue, props.value]); const clearIcon = (