fix(combo-box): clear button supports "Space" key (#2168)

Fixes #2166
This commit is contained in:
Eric Liu 2025-06-07 12:33:59 -07:00 committed by GitHub
commit 95c06a83b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 36 additions and 14 deletions

View file

@ -75,7 +75,7 @@
}
}}
on:keydown|stopPropagation={(e) => {
if (!disabled && e.key === "Enter") {
if (!disabled && (e.key === "Enter" || e.key === " ")) {
dispatch("clear", e);
}
}}
@ -103,7 +103,7 @@
}
}}
on:keydown|stopPropagation={(e) => {
if (!disabled && e.key === "Enter") {
if (!disabled && (e.key === "Enter" || e.key === " ")) {
dispatch("clear", e);
}
}}