Clear search term when clicking popover pill (#3408)

This commit is contained in:
WithoutPants
2023-02-08 11:07:15 +11:00
committed by GitHub
parent 6f2057a51e
commit cb3545a303
3 changed files with 11 additions and 0 deletions

View File

@@ -91,6 +91,13 @@ export const ListFilter: React.FC<IListFilterProps> = ({
}
}, [customPageSizeShowing, perPageFocus]);
// clear search input when filter is cleared
useEffect(() => {
if (filter.searchTerm === "") {
queryRef.current.value = "";
}
}, [filter.searchTerm, queryRef]);
function onChangePageSize(val: string) {
if (val === "custom") {
// added timeout since Firefox seems to trigger the rootClose immediately