only open when key press is printable

pull/479/head
Cory LaViska 2021-06-10 09:33:02 -04:00
rodzic 529c187bc4
commit ba029db24e
2 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -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

Wyświetl plik

@ -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();