Skip to content

Commit 3c588ad

Browse files
authored
Merge pull request #55277 from bernhardoj/fix/55073-search-input-isn't-cleared-when-closed
Clear the search input when the modal is closed
2 parents 018df99 + 54231e5 commit 3c588ad

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/PushRowWithModal/PushRowModal.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,20 @@ function PushRowModal({isVisible, selectedOption, onOptionChange, onClose, optio
6262
onClose();
6363
};
6464

65+
const handleClose = () => {
66+
onClose();
67+
setSearchValue('');
68+
};
69+
6570
const searchResults = searchOptions(debouncedSearchValue, options);
6671
const headerMessage = debouncedSearchValue.trim() && !searchResults.length ? translate('common.noResultsFound') : '';
6772

6873
return (
6974
<Modal
70-
onClose={onClose}
75+
onClose={handleClose}
7176
isVisible={isVisible}
7277
type={CONST.MODAL.MODAL_TYPE.RIGHT_DOCKED}
73-
onModalHide={onClose}
78+
onModalHide={handleClose}
7479
shouldUseCustomBackdrop
7580
useNativeDriver
7681
>

0 commit comments

Comments
 (0)