Reset table pagination when search term changes (#5534)

This commit is contained in:
Oliver 2023-09-13 21:57:24 +10:00 committed by GitHub
parent b3e8195e10
commit 1ed3d21a00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -253,6 +253,11 @@ export function InvenTreeTable({
// Search term
const [searchTerm, setSearchTerm] = useState<string>('');
// Reset the pagination state when the search term changes
useEffect(() => {
setPage(1);
}, [searchTerm]);
/*
* Construct query filters for the current table
*/