From 90642b4cda5caa7fc51342b63105d9bcaa468893 Mon Sep 17 00:00:00 2001 From: Abdelsalem <46495975+AbdelHedhili@users.noreply.github.com> Date: Wed, 15 Nov 2023 14:12:51 +0100 Subject: [PATCH] Fix Clear searchbar after selection (#311) * clear searchbar after selection Signed-off-by: Abdelsalem --- src/components/ElementSearchDialog/element-search-dialog.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/ElementSearchDialog/element-search-dialog.js b/src/components/ElementSearchDialog/element-search-dialog.js index 15586beb..2bce31f4 100644 --- a/src/components/ElementSearchDialog/element-search-dialog.js +++ b/src/components/ElementSearchDialog/element-search-dialog.js @@ -47,6 +47,11 @@ const ElementSearchDialog = (props) => { } }, [searchTermDisabled, searchTermDisableReason]); + // to reset the value between the dialog closing and opening + useEffect(() => { + setValue((old) => (!open ? null : old)); + }, [open]); + const handleSearchTermChange = (term) => { if (term) { setLoading(true);