1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

feat: make search debounce time extensible (#4172)

This commit is contained in:
Davide Iadeluca
2025-01-31 09:17:21 +01:00
committed by GitHub
parent 0b995b96ef
commit 962d95746d
2 changed files with 6 additions and 1 deletions

View File

@@ -7,6 +7,11 @@ export default class SearchManager<State extends SearchState = SearchState> {
*/
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.

View File

@@ -324,7 +324,7 @@ export default class SearchModal<CustomAttrs extends ISearchModalAttrs = ISearch
this.searchState.cache(query);
m.redraw();
}, 250);
}, SearchManager.SEARCH_DEBOUNCE_TIME_MS);
}
/**