mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-26 19:44:57 +02:00
add debounce for search, increase the timer for fulltext updates (#5844)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
@@ -295,6 +295,15 @@
|
||||
$: void translate(view.string.ActionPlaceholder, {}).then((res) => {
|
||||
phTraslate = res
|
||||
})
|
||||
let timer: any
|
||||
$: _search = search
|
||||
function restartTimer (): void {
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
search = _search
|
||||
dispatch('change', _search)
|
||||
}, 500)
|
||||
}
|
||||
</script>
|
||||
|
||||
<ActionContext
|
||||
@@ -364,10 +373,14 @@
|
||||
class="actionsInput"
|
||||
bind:this={textHTML}
|
||||
type="text"
|
||||
bind:value={search}
|
||||
bind:value={_search}
|
||||
placeholder={phTraslate}
|
||||
on:change
|
||||
on:input
|
||||
on:change={() => {
|
||||
restartTimer()
|
||||
}}
|
||||
on:input={() => {
|
||||
restartTimer()
|
||||
}}
|
||||
on:keydown
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user