mirror of
https://github.com/flarum/framework.git
synced 2025-02-19 07:13:24 +08:00
feat: make search debounce time extensible (#4172)
This commit is contained in:
parent
0b995b96ef
commit
962d95746d
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user