Skip to content

Expand/Collapse Icons Should Not Render When No Children Nodes Are Available #20

@pkmccaffrey

Description

@pkmccaffrey

Currently, if a given tree node has no children (but the nodes array is defined as empty), the expand/collapse icons still render. I believe that if the length of the nodes array is zero, this should be treated the same as not supplying a nodes property.

My current workaround is for my TreeNode typescript class to provide a trimNodes() function:

      public trimNodes() {

            if (this.nodes.length == 0) {
                delete (this as any).nodes;
            } else {
                for (const node of this.nodes) {
                    node.trimNodes();
                }
            }

        }

While this works, and is easy enough, it would be nice if bstreeview handled this internally.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions