Skip to content

Commit

Permalink
Fix Clear searchbar after selection (#311)
Browse files Browse the repository at this point in the history
* clear searchbar after selection

Signed-off-by: Abdelsalem <[email protected]>
  • Loading branch information
AbdelHedhili authored Nov 15, 2023
1 parent b82955b commit 90642b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/ElementSearchDialog/element-search-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 90642b4

Please sign in to comment.