Et2Tree: Avoid error if onclick property was not set

This commit is contained in:
nathan 2024-02-13 10:41:27 -07:00
parent 51f23a0dcf
commit cf8de8f108

View File

@ -622,10 +622,12 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement)
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")
{
this.onclick(event.detail.selection[0].id, this, event.detail.previous) this.onclick(event.detail.selection[0].id, this, event.detail.previous)
} }
} }
}
@sl-expand=${ @sl-expand=${
(event) => { (event) => {
event.detail.id = event.target.id event.detail.id = event.target.id