From cf8de8f1085aad183c2476f309a52417d6f2780d Mon Sep 17 00:00:00 2001 From: nathan Date: Tue, 13 Feb 2024 10:41:27 -0700 Subject: [PATCH] Et2Tree: Avoid error if onclick property was not set --- api/js/etemplate/Et2Tree/Et2Tree.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/js/etemplate/Et2Tree/Et2Tree.ts b/api/js/etemplate/Et2Tree/Et2Tree.ts index e265528e95..3450640260 100644 --- a/api/js/etemplate/Et2Tree/Et2Tree.ts +++ b/api/js/etemplate/Et2Tree/Et2Tree.ts @@ -622,8 +622,10 @@ export class Et2Tree extends Et2WidgetWithSelectMixin(LitElement) this._currentOption = this.getNode(event.detail.selection[0].id); event.detail.previous = this._previousOption.id; this._currentSlTreeItem = event.detail.selection[0]; - - this.onclick(event.detail.selection[0].id, this, event.detail.previous) + if(typeof this.onclick == "function") + { + this.onclick(event.detail.selection[0].id, this, event.detail.previous) + } } } @sl-expand=${