p-tree: Unselectable children when no key given in TreeNode #16819
Labels
Resolution: Help Wanted
Issue or pull request requires extra help and feedback
Milestone
Describe the bug
Caused by: #16430
This fix causes nodes to be unselectable when nodes do not have a key.
example:
https://stackblitz.com/edit/github-fos6jj-ljajyw?file=src%2Fapp%2Fapp.component.ts
Screen recording (i'm clicking the nodes, but they dont get selected):
If you remove the keys sicne this fix selection does not work, with keys, it does work.
Reason is that since this fix we are cloning nodes:
But without keys we do a full contents comparison that always fails:
Environment
https://stackblitz.com/edit/github-fos6jj-ljajyw?file=src%2Fapp%2Fapp.component.ts
Reproducer
https://stackblitz.com/edit/github-fos6jj-ljajyw?file=src%2Fapp%2Fapp.component.ts
Angular version
17.3.6
PrimeNG version
17.18.11
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.20.3
Browser(s)
No response
Steps to reproduce the behavior
Create a p-tree with checkboxes and TreeNodes without key
Click on a checkbox of the tree
https://stackblitz.com/edit/github-fos6jj-ljajyw?file=src%2Fapp%2Fapp.component.ts
Screen recording (i'm clicking the nodes, but they dont get selected):
Expected behavior
The treenodes should be selectable even when they have no key as was the case before #16430 was merged
The text was updated successfully, but these errors were encountered: