You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by hn...@apache.org on 2021/04/13 15:14:48 UTC

[myfaces-tobago] branch master updated: fix(tree): NPE in treeSelect

This is an automated email from the ASF dual-hosted git repository.

hnoeth pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c96f0b  fix(tree): NPE in treeSelect
2c96f0b is described below

commit 2c96f0bb84fa90155b11709748839dac95d44446
Author: Henning Noeth <hn...@apache.org>
AuthorDate: Tue Apr 13 16:57:02 2021 +0200

    fix(tree): NPE in treeSelect
---
 .../tobago-theme-standard/src/main/ts/tobago-tree-select.ts   | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-tree-select.ts b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-tree-select.ts
index a5b7241..563ae99 100644
--- a/tobago-theme/tobago-theme-standard/src/main/ts/tobago-tree-select.ts
+++ b/tobago-theme/tobago-theme-standard/src/main/ts/tobago-tree-select.ts
@@ -26,7 +26,9 @@ export class TreeSelect extends HTMLElement {
   }
 
   connectedCallback(): void {
-    this.input.addEventListener("change", this.select.bind(this));
+    if (this.input) {
+      this.input.addEventListener("change", this.select.bind(this));
+    }
   }
 
   select(event: Event): void {
@@ -45,13 +47,6 @@ export class TreeSelect extends HTMLElement {
         if (this.tree.selectable === Selectable.multiCascade) {
           const treeNodeIds = [];
           this.selectChildren(this.treeSelectChildren, this.input.checked, treeNodeIds);
-
-          /*if (treeNodeIds.length > 0) {
-            for (const id of treeNodeIds) {
-              let ts: TreeSelect = document.getElementById(id).querySelector("tobago-tree-select") as TreeSelect;
-              ts.input.dispatchEvent(new Event("change", {bubbles: false}));
-            }
-          }*/
         }
         break;
     }