Skip to content

OrganizationChart: duplicate child nodes when parent has more than 10 children #8540

@vaibavdk-pieq

Description

@vaibavdk-pieq

Describe the bug

When an OrganizationChart node has more than MAX_CHILDREN_PER_ROW (10) children, child nodes are rendered multiple times. createChildrenSection() correctly chunks children into rows, but createLinesDown(), createLinesMiddle(), and createChildNodes() each re-chunk all children and render every row on each iteration instead of only the current row slice. For example, 16 children produce two chunks and the full subtree is duplicated (each child appears twice).

Reproducer

https://stackblitz.com/edit/vitejs-vite-pekean1c

System Information

System:
    OS: Windows 11 10.0.26200
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1145G7 @ 2.60GHz
    Memory: 1.79 GB / 15.71 GB
  Binaries:
    Node: 22.18.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Users\LENOVO\AppData\Roaming\npm\yarn.CMD
    npm: 11.5.2 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 148.0.7778.179
    Edge: Chromium (140.0.3485.54)
    Internet Explorer: 11.0.26100.8115

Steps to reproduce the behavior

Steps to reproduce

  1. Render OrganizationChart with data where one node has 11 or more children.
  2. Ensure that node is expanded.
  3. Inspect the chart or DOM.

Expected behavior

Expected behavior

Each child appears exactly once, split across rows of at most 10 children per row.

Actual behavior

Children are duplicated once per chunk (e.g. 11–20 children → 2× duplication).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions