Skip to content

fix(OrganizationChart): prevent duplicate child rows when chunking#8541

Open
vaibavdk-pieq wants to merge 1 commit into
primefaces:masterfrom
vaibavdk-pieq:fix/organizationchart-duplicate-child-rows
Open

fix(OrganizationChart): prevent duplicate child rows when chunking#8541
vaibavdk-pieq wants to merge 1 commit into
primefaces:masterfrom
vaibavdk-pieq:fix/organizationchart-duplicate-child-rows

Conversation

@vaibavdk-pieq
Copy link
Copy Markdown

Fixes #8540

Defect Fixes

When a node has more than MAX_CHILDREN_PER_ROW (10) children, createChildrenSection() chunks children into rows, but createLinesDown(), createLinesMiddle(), and createChildNodes() each re-chunked all children and rendered every row on each iteration. That duplicated the full child subtree once per chunk (e.g. 16 children appeared twice).

This PR updates those helpers to render only the row slice passed from createChildrenSection(), so each child is rendered once across chunked rows.

Summary

  • Remove redundant chunkArray / rows.map from createLinesDown, createLinesMiddle, and createChildNodes.
  • Keep chunking logic solely in createChildrenSection().

Test plan

  • Open OrganizationChart with a node that has 11+ expanded children (e.g. 16).
  • Confirm each child appears once in the UI/DOM (no duplication per chunk).
  • Confirm connector lines still align correctly for multi-row layouts.
  • Regression: nodes with ≤10 children render as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant