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:
@@ -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.
|
||||
|
@@ -324,7 +324,7 @@ export default class SearchModal<CustomAttrs extends ISearchModalAttrs = ISearch
|
||||
|
||||
this.searchState.cache(query);
|
||||
m.redraw();
|
||||
}, 250);
|
||||
}, SearchManager.SEARCH_DEBOUNCE_TIME_MS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user