Skip to content

Commit 7f5f047

Browse files
balco0110Mojsoski, Blagoja (UIS)
andauthored
fix: add clearing of combobox on Backspace or Delete key press (#2816)
…gle-selection mode <!-- ## Title: Please consider adding the [skip chromatic] flag to the PR title in case you dont need chromatic testing your changes. --> ## Description: <!-- *PR notes: Please describe the changes in this PR.* --> Closes: #2785 ## Definition of Reviewable: <!-- *PR notes: Irrelevant elements should be removed.* --> - [ ] Documentation is created/updated - [ ] Migration Guide is created/updated <!-- *PR notes: If this PR includes a BREAKING CHANGE, a migration guide is needed to explain how users can migrate between versions. * --> - [ ] E2E tests (features, a11y, bug fixes) are created/updated <!-- *If this PR includes a bug fix, an E2E test is necessary to verify the change. If the fix is purely visual, ensuring it is captured within our chromatic screenshot tests is sufficient.* --> - [ ] Stories (features, a11y) are created/updated - [x] relevant tickets are linked --------- Co-authored-by: Mojsoski, Blagoja (UIS) <blagoja.mojsoski@union-investment.de>
1 parent c188454 commit 7f5f047

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.changeset/some-beers-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solid-design-system/components': minor
3+
---
4+
5+
Add clearing of `sd-combobox` on Backspace or Delete key press

packages/components/src/components/combobox/combobox.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ export default class SdCombobox extends SolidElement implements SolidFormControl
449449
return;
450450
}
451451

452+
if (!this.multiple && (event.key === 'Backspace' || event.key === 'Delete')) {
453+
this.clearCombobox();
454+
return;
455+
}
456+
452457
// Handle enter.
453458
if (event.key === 'Enter') {
454459
const currentOption = this.getCurrentOption();

0 commit comments

Comments
 (0)