Skip to content

Tree Component Not Rendering When Adding First Node at Level 2 #9378

@hemanthenggr

Description

@hemanthenggr

Problem Description:
I’m working with a tree component that supports hierarchical data (Level 0 → Level 1 → Level 2, and so on).

  • Adding nodes at Level 0 and Level 1 works fine — the tree re-renders immediately, and the new node becomes visible.
  • But when I try to add a node at Level 2, the tree does not update in the UI.

Debug Observations:

  1. When adding a node at Level 2, the callback/refresh function that usually triggers after node insertion is not fired.
  2. This issue only occurs when adding the first node at Level 2 (i.e., when there are no existing child nodes).
  3. If there is already at least one node at Level 2, adding subsequent nodes works correctly — the tree refreshes and renders them.
  4. So the bug seems specifically related to initializing the first child at deeper levels rather than appending additional nodes.
  5. This results in inconsistent behavior between shallow levels (0/1) and deeper levels (2+).

Expected Behavior:

  • The tree should re-render whenever a new node is added at any level, including the first node at Level 2.
  • The callback that updates the tree should fire consistently regardless of depth.

Actual Behavior:

  • Tree updates correctly at Level 0 and Level 1.
  • At Level 2, the first node added does not appear in the UI.
  • No callback/event is triggered after insertion.

Question:
Has anyone else faced this issue when working with hierarchical tree components?

  • Do I need to explicitly force a refresh or rebind data when adding the first child node at a deeper level?
  • Could this be related to how the tree handles empty child collections (e.g., null vs. empty array)?

Any insights or possible workarounds would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions