fix(search): collapse expandable search if value is falsy (#1987)

Fixes #1981
This commit is contained in:
jmeurice 2024-08-08 21:36:28 +02:00 committed by GitHub
commit 216d5a39b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 = '';