kopia lustrzana https://github.com/shoelace-style/shoelace
fixes #458
rodzic
15cb1cb746
commit
501869c7aa
|
@ -9,6 +9,7 @@ _During the beta period, these restrictions may be relaxed in the event of a mis
|
|||
## Next
|
||||
|
||||
- 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)
|
||||
|
||||
## 2.0.0-beta.43
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ export default class SlSelect extends LitElement {
|
|||
@query('.select__menu') menu: SlMenu;
|
||||
|
||||
private inputId = `select-${++id}`;
|
||||
private hasInitialized = false;
|
||||
private helpTextId = `select-help-text-${id}`;
|
||||
private labelId = `select-label-${id}`;
|
||||
private resizeObserver: ResizeObserver;
|
||||
|
@ -129,6 +130,7 @@ export default class SlSelect extends LitElement {
|
|||
this.resizeObserver.observe(this);
|
||||
this.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);
|
||||
this.syncItemsFromValue();
|
||||
this.hasInitialized = true;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -306,7 +308,10 @@ export default class SlSelect extends LitElement {
|
|||
@watch('value')
|
||||
handleValueChange() {
|
||||
this.syncItemsFromValue();
|
||||
this.slChange.emit();
|
||||
|
||||
if (this.hasInitialized) {
|
||||
this.slChange.emit();
|
||||
}
|
||||
}
|
||||
|
||||
resizeMenu() {
|
||||
|
|
Ładowanie…
Reference in New Issue