feat(search): clear input on escape key (#448)

This commit is contained in:
Eric Liu 2020-12-05 14:27:59 -08:00 committed by GitHub
commit 61753b8b82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View file

@ -120,6 +120,13 @@
}}"
on:focus
on:blur
on:keydown
on:keydown="{({ key }) => {
if (key === 'Escape') {
value = '';
dispatch('clear');
}
}}"
/>
<button
type="button"