From 962d95746dfc2bfe2162b7861d3f9b54cc8f7544 Mon Sep 17 00:00:00 2001 From: Davide Iadeluca <146922689+DavideIadeluca@users.noreply.github.com> Date: Fri, 31 Jan 2025 09:17:21 +0100 Subject: [PATCH] feat: make search debounce time extensible (#4172) --- framework/core/js/src/common/SearchManager.ts | 5 +++++ framework/core/js/src/common/components/SearchModal.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/framework/core/js/src/common/SearchManager.ts b/framework/core/js/src/common/SearchManager.ts index 6b2010015..5c512c8db 100644 --- a/framework/core/js/src/common/SearchManager.ts +++ b/framework/core/js/src/common/SearchManager.ts @@ -7,6 +7,11 @@ export default class SearchManager { */ public static MIN_SEARCH_LEN = 3; + /** + * Time to wait (in milliseconds) after the user stops typing before triggering a search. + */ + public static SEARCH_DEBOUNCE_TIME_MS = 250; + /** * An object which stores previously searched queries and provides convenient * tools for retrieving and managing search values. diff --git a/framework/core/js/src/common/components/SearchModal.tsx b/framework/core/js/src/common/components/SearchModal.tsx index 29e8dd248..b58b0a55b 100644 --- a/framework/core/js/src/common/components/SearchModal.tsx +++ b/framework/core/js/src/common/components/SearchModal.tsx @@ -324,7 +324,7 @@ export default class SearchModal