Write the URL immediately when a search filter is cleared

The search box clear (X) button cleared the filter live but only wrote the URL
when the dropdown closed. commitFilter now accepts an explicit value so the
clear handlers can commit right away (avoiding the stale-state race of reading
the live override in the same event), for both useColumnSearch and the Users
filter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 4.8 committed 2026-07-02 21:37:32 +00:00
1 parent bb4c82ea5a
commit 2898fdf5d3
3 files changed
+22 -12

No files matched your search

@@ -47,6 +47,8 @@ export default function useColumnSearch<T>(
onClear={() => {
setSelectedKeys([]);
tableState.setFilter(columnKey, null);
// Clearing is a deliberate action, so write it to the URL right away.
tableState.commitFilter(columnKey, null);
}}
/>
</div>