mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-20 07:10:02 +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
|
$: _search = value
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
let timer: any
|
||||||
|
|
||||||
|
function restartTimer () {
|
||||||
|
clearTimeout(timer)
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
value = _search
|
||||||
|
dispatch('change', _search)
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<EditWithIcon
|
<EditWithIcon
|
||||||
@ -22,6 +31,7 @@
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
on:input={() => {
|
on:input={() => {
|
||||||
|
restartTimer()
|
||||||
if (_search === '') {
|
if (_search === '') {
|
||||||
value = ''
|
value = ''
|
||||||
dispatch('change', '')
|
dispatch('change', '')
|
||||||
|
Loading…
Reference in New Issue
Block a user