summaryrefslogtreecommitdiff
path: root/components/data-table/data-table-grobal-filter.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'components/data-table/data-table-grobal-filter.tsx')
-rw-r--r--components/data-table/data-table-grobal-filter.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/components/data-table/data-table-grobal-filter.tsx b/components/data-table/data-table-grobal-filter.tsx
index a1f0a6f3..ca60bf02 100644
--- a/components/data-table/data-table-grobal-filter.tsx
+++ b/components/data-table/data-table-grobal-filter.tsx
@@ -24,8 +24,8 @@ export function DataTableGlobalFilter() {
// Debounced callback that sets the URL param after `delay` ms
const debouncedSetSearch = useDebouncedCallback((value: string) => {
- setSearchValue(value)
- }, 300) // 300ms or chosen delay
+ if (value !== searchValue) setSearchValue(value.trim() === "" ? undefined : value);
+ }, 300)
// When user types, update local `tempValue` immediately,
// then call the debounced function to update the query param