Fix duplicate slBlur/slFocus in select; closes #200

pull/224/head
Cory LaViska 2020-09-04 08:02:39 -04:00
rodzic 84d4421575
commit b51978b1a6
2 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -4,6 +4,7 @@
- Fixed a bug where swapping an animated element wouldn't restart the animation in `sl-animation`
- Fixed a bug where the cursor was incorrect when `sl-select` was disabled
- Fixed a bug where `slBlur` and `slFocus` were emitted twice in `sl-select`
- Fixed a bug where clicking on `sl-menu` wouldn't focus it
- Improved keyboard logic in `sl-dropdown`, `sl-menu`, and `sl-select`
- Updated `sl-animation` to stable

Wyświetl plik

@ -162,12 +162,14 @@ export class Select {
return Array.isArray(this.value) ? this.value : [this.value];
}
handleBlur() {
handleBlur(event: CustomEvent) {
event.stopPropagation();
this.hasFocus = false;
this.slBlur.emit();
}
handleFocus() {
handleFocus(event: CustomEvent) {
event.stopPropagation();
this.hasFocus = true;
this.slFocus.emit();
this.input.setSelectionRange(0, 0);