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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

View File

@ -14,6 +14,7 @@
* Changed performer aliases to be a list, rather than a string field. ([#3113](https://github.com/stashapp/stash/pull/3113))
### 🐛 Bug fixes
* Fixed clicking popover pills not clearing search term. ([#3408](https://github.com/stashapp/stash/pull/3408))
* Fixed URL not being preserved when redirected to login. ([#3305](https://github.com/stashapp/stash/pull/3305))
* Fixed scene previews not being overwritten when Overwrite option is selected. ([#3256](https://github.com/stashapp/stash/pull/3256))
* Fixed objects without titles not being sorted correctly with objects with titles. ([#3244](https://github.com/stashapp/stash/pull/3244))

View File

@ -93,6 +93,9 @@ export class ListFilterModel {
}
if (params.q) {
this.searchTerm = params.q.trim();
} else {
// #1795 - reset search term if not provided
this.searchTerm = "";
}
this.currentPage = params.p ? Number.parseInt(params.p, 10) : 1;
if (params.perPage) this.itemsPerPage = Number.parseInt(params.perPage, 10);