fix unset this._currentOption prevents folder-change in mail, maybe it would be better to properly initialise this._currentOption

This commit is contained in:
ralf 2024-02-14 11:19:41 +02:00
parent f913f2f890
commit af7b4658e7

View File

@ -627,7 +627,7 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
.selection=${this.multiple ? "multiple" : "single"} .selection=${this.multiple ? "multiple" : "single"}
@sl-selection-change=${ @sl-selection-change=${
(event: any) => { (event: any) => {
this._previousOption = this._currentOption this._previousOption = this._currentOption || this.getNode(this.value);
this._currentOption = this.getNode(event.detail.selection[0].id); this._currentOption = this.getNode(event.detail.selection[0].id);
event.detail.previous = this._previousOption.id; event.detail.previous = this._previousOption.id;
this._currentSlTreeItem = event.detail.selection[0]; this._currentSlTreeItem = event.detail.selection[0];
@ -863,6 +863,4 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
} }
customElements.define("et2-tree", Et2Tree); customElements.define("et2-tree", Et2Tree);