mirror of
https://github.com/flarum/core.git
synced 2025-08-08 01:16:52 +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;
|
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
|
* An object which stores previously searched queries and provides convenient
|
||||||
* tools for retrieving and managing search values.
|
* tools for retrieving and managing search values.
|
||||||
|
@@ -324,7 +324,7 @@ export default class SearchModal<CustomAttrs extends ISearchModalAttrs = ISearch
|
|||||||
|
|
||||||
this.searchState.cache(query);
|
this.searchState.cache(query);
|
||||||
m.redraw();
|
m.redraw();
|
||||||
}, 250);
|
}, SearchManager.SEARCH_DEBOUNCE_TIME_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user