We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 782d79a commit a0e9731Copy full SHA for a0e9731
lib/ffdocs/view/javascript/search.js
@@ -4,7 +4,14 @@ class SearchInput {
4
this.prefetchLinks = new Set();
5
6
elem.addEventListener("input", () => {
7
- this.update(elem.value.trim().toLowerCase());
+ const query = elem.value.trim().toLowerCase();
8
+ const delay = query.length < 3 ? 300 : 50;
9
+
10
+ if (this.timerAfterInput !== undefined) {
11
+ clearTimeout(this.timerAfterInput);
12
+ }
13
14
+ this.timerAfterInput = setTimeout(() => this.update(query), delay);
15
});
16
17
elem.addEventListener("keydown", (event) => {
0 commit comments