p-tree: Parent node always undefined in node selection events when Virtual Scrolling is enabled #12718
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
event.node.parent
is alwaysundefined
inonNodeSelect
of a PrimeNG tree when virtual scrolling is enabledEnvironment
Discovered in PrimeNG 11.4.10 and reproduced in 15.2.0 (see the attached stackblitz for a demo)
Reproducer
https://stackblitz.com/edit/primeng-treeselection-demo-yvxqt7?file=src/app/app.component.html
Angular version
14.1.3
PrimeNG version
15.2.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.13.2
Browser(s)
No response
Steps to reproduce the behavior
parent
references are set in theTreeNode
model instances.event.node.parent
will be defined for non-root nodes.<p-tree>
event.node.parent
will beundefined
for all nodes.Expected behavior
event.node.parent
should contain a valid reference to the parent node for all non-root nodes, even when virtual scrolling is enabled.The text was updated successfully, but these errors were encountered: