mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 10:51:06 +00:00
feat(search): clear input on escape key (#448)
This commit is contained in:
parent
f6877f3809
commit
61753b8b82
4 changed files with 10 additions and 0 deletions
|
@ -120,6 +120,13 @@
|
|||
}}"
|
||||
on:focus
|
||||
on:blur
|
||||
on:keydown
|
||||
on:keydown="{({ key }) => {
|
||||
if (key === 'Escape') {
|
||||
value = '';
|
||||
dispatch('clear');
|
||||
}
|
||||
}}"
|
||||
/>
|
||||
<button
|
||||
type="button"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue