mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(search): collapse expandable search if value is falsy (#1987)
Fixes #1981
This commit is contained in:
parent
6140c3c5a9
commit
216d5a39b1
1 changed files with 2 additions and 2 deletions
|
@ -140,7 +140,7 @@
|
|||
}}"
|
||||
on:blur
|
||||
on:blur="{() => {
|
||||
if (expanded && value.trim().length === 0) {
|
||||
if (expanded && (value === '' || value == null)) {
|
||||
expanded = false;
|
||||
}
|
||||
}}"
|
||||
|
@ -159,7 +159,7 @@
|
|||
aria-label="{closeButtonLabelText}"
|
||||
disabled="{disabled}"
|
||||
class:bx--search-close="{true}"
|
||||
class:bx--search-close--hidden="{value === ''}"
|
||||
class:bx--search-close--hidden="{value === '' || value == null}"
|
||||
on:click
|
||||
on:click="{() => {
|
||||
value = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue