diff --git a/docs/resources/changelog.md b/docs/resources/changelog.md index a44b96fd..c2f12e28 100644 --- a/docs/resources/changelog.md +++ b/docs/resources/changelog.md @@ -12,6 +12,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Fixed a bug in `sl-select` where `sl-blur` was emitted prematurely [#456](https://github.com/shoelace-style/shoelace/issues/456) - Fixed a bug in `sl-select` where no selection with `multiple` resulted in an incorrect value [#457](https://github.com/shoelace-style/shoelace/issues/457) - Fixed a bug in `sl-select` where `sl-change` was emitted immediately after connecting to the DOM [#458](https://github.com/shoelace-style/shoelace/issues/458) +- Fixed a bug in `sl-select` where non-printable keys would cause the menu to open ## 2.0.0-beta.43 diff --git a/src/components/select/select.ts b/src/components/select/select.ts index 19a02f0d..eabfc408 100644 --- a/src/components/select/select.ts +++ b/src/components/select/select.ts @@ -239,8 +239,8 @@ export default class SlSelect extends LitElement { } } - // All other keys open the menu and initiate type to select - if (!this.isOpen) { + // All other "printable" keys open the menu and initiate type to select + if (!this.isOpen && event.key.length === 1) { event.stopPropagation(); event.preventDefault(); this.dropdown.show();