Commit 336a767
authored
Fix: abort previous filter request on new keystroke (#1263)
The autosubmit filter had two issues:
1. The debounce() utility used a blockedByPromise mechanism that
silently discarded keystrokes while a request was in flight.
When the server was slow, the user could type "abc" but only
get results for "a" because "b" and "c" were dropped.
Removed blockedByPromise so debounce always resets the timer.
2. When typing slowly (>200ms between keystrokes), each keystroke
triggered a separate AJAX request, but previous requests were
never aborted. Added data-naja-unique attribute to the filter
form so Naja's built-in UniqueExtension automatically aborts
the previous request when a new one starts.1 parent 043d16e commit 336a767
2 files changed
+2
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | 124 | | |
126 | 125 | | |
127 | | - | |
128 | | - | |
129 | 126 | | |
130 | 127 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 128 | + | |
139 | 129 | | |
140 | 130 | | |
141 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
0 commit comments