mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-21 10:27:52 +02:00
Et2Tree: Avoid some errors on first leaf selection
This commit is contained in:
parent
27418ec0f4
commit
5f26b940e3
@ -625,9 +625,9 @@ 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.getNode(this.value);
|
this._previousOption = this._currentOption ?? (this.value.length ? this.getNode(this.value) : null);
|
||||||
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];
|
||||||
if(typeof this.onclick == "function")
|
if(typeof this.onclick == "function")
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user