fix type to select bug

pull/490/head
Cory LaViska 2021-07-26 08:23:46 -04:00
rodzic e938f94ffc
commit 807cba18d1
2 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
## Next
- Added a console error that appears when menu items have duplicate values in `sl-select`
- Fixed a bug in `sl-menu` where pressing <kbd>Enter</kbd> after using type to select would result in the wrong value
## 2.0.0-beta.47

Wyświetl plik

@ -74,6 +74,7 @@ export default class SlMenu extends LitElement {
const slot = item.shadowRoot!.querySelector('slot:not([name])') as HTMLSlotElement;
const label = getTextContent(slot).toLowerCase().trim();
if (label.substring(0, this.typeToSelectString.length) === this.typeToSelectString) {
this.setCurrentItem(item);
item.focus();
break;
}