Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pkmccaffrey opened this issue Dec 29, 2020 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@pkmccaffrey
Copy link

pkmccaffrey commented Dec 29, 2020

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.

@chniter chniter self-assigned this May 25, 2021
@chniter chniter added the bug Something isn't working label May 25, 2021
@chniter chniter added this to the v1.3.0 milestone May 25, 2021
@chniter
Copy link
Owner

chniter commented May 25, 2021

Hi,

Thanks for reporting bug.
Will be fixed on the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants