mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
fix(header-search): "Escape" should close empty search bar (#1853)
This commit is contained in:
parent
b0b51a818a
commit
e667352329
1 changed files with 5 additions and 0 deletions
|
@ -115,6 +115,11 @@
|
|||
}
|
||||
break;
|
||||
case 'Escape':
|
||||
if (value === '') {
|
||||
// If the search bar is empty, close it.
|
||||
active = false;
|
||||
}
|
||||
|
||||
// Reset the search query but keep the search bar active.
|
||||
// Do not dispatch "clear" event as that should fire only on the "x" button.
|
||||
value = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue