From 674de89a80cc643de38eb2cb1e3a74a5f9b17188 Mon Sep 17 00:00:00 2001 From: alejandrobailo Date: Tue, 31 Mar 2026 16:45:50 +0200 Subject: [PATCH] fix(ui): restore Enter-only search for uncontrolled mode in all tables --- ui/components/ui/table/data-table-search.tsx | 33 ++------------------ 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/ui/components/ui/table/data-table-search.tsx b/ui/components/ui/table/data-table-search.tsx index 853a27160c..fa85bdb2e1 100644 --- a/ui/components/ui/table/data-table-search.tsx +++ b/ui/components/ui/table/data-table-search.tsx @@ -111,38 +111,9 @@ export const DataTableSearch = ({ return; } - // Uncontrolled mode: update display + debounce URL update + // Uncontrolled mode: only update display value on keystroke. + // The actual URL update happens on Enter (see onKeyDown handler). setInternalValue(newValue); - - if (debounceTimeoutRef.current) { - clearTimeout(debounceTimeoutRef.current); - } - - if (paramPrefix) { - setIsLoading(true); - debounceTimeoutRef.current = setTimeout(() => { - const params = new URLSearchParams(searchParams.toString()); - if (newValue) { - params.set(searchParam, newValue); - } else { - params.delete(searchParam); - } - params.set(pageParam, "1"); - router.push(`${pathname}?${params.toString()}`, { scroll: false }); - setIsLoading(false); - }, SEARCH_DEBOUNCE_MS); - } else { - if (newValue) { - setIsLoading(true); - debounceTimeoutRef.current = setTimeout(() => { - updateFilter("search", newValue); - setIsLoading(false); - }, SEARCH_DEBOUNCE_MS); - } else { - setIsLoading(false); - updateFilter("search", null); - } - } }; // Cleanup timeout on unmount