mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 12:25:17 +00:00
UBER-76: trigger search after timeout (#3193)
Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
This commit is contained in:
parent
4949142b19
commit
d816b99e54
@ -8,6 +8,15 @@
|
||||
|
||||
$: _search = value
|
||||
const dispatch = createEventDispatcher()
|
||||
let timer: any
|
||||
|
||||
function restartTimer () {
|
||||
clearTimeout(timer)
|
||||
timer = setTimeout(() => {
|
||||
value = _search
|
||||
dispatch('change', _search)
|
||||
}, 500)
|
||||
}
|
||||
</script>
|
||||
|
||||
<EditWithIcon
|
||||
@ -22,6 +31,7 @@
|
||||
}
|
||||
}}
|
||||
on:input={() => {
|
||||
restartTimer()
|
||||
if (_search === '') {
|
||||
value = ''
|
||||
dispatch('change', '')
|
||||
|
Loading…
Reference in New Issue
Block a user