Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p-tree: Unselectable children when no key given in TreeNode #16819

Open
SuRaMoN opened this issue Nov 22, 2024 · 1 comment
Open

p-tree: Unselectable children when no key given in TreeNode #16819

SuRaMoN opened this issue Nov 22, 2024 · 1 comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Milestone

Comments

@SuRaMoN
Copy link

SuRaMoN commented Nov 22, 2024

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):
388913003-cb4aa37f-b965-4b5e-a426-dad8d400683a

If you remove the keys sicne this fix selection does not work, with keys, it does work.
388913472-d8cb6566-a116-40ce-ae02-af0aaec45111

Reason is that since this fix we are cloning nodes:
388913235-09252381-05b9-4bc4-b067-1a019e8129af

But without keys we do a full contents comparison that always fails:
388913954-9f8c10fe-93ba-4386-ad77-70b320eb2795

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):
388913003-cb4aa37f-b965-4b5e-a426-dad8d400683a

Expected behavior

The treenodes should be selectable even when they have no key as was the case before #16430 was merged

@SuRaMoN SuRaMoN added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 22, 2024
@mertsincan mertsincan added Resolution: Help Wanted Issue or pull request requires extra help and feedback and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Nov 22, 2024
@mertsincan mertsincan added this to the Future milestone Nov 22, 2024
Copy link

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Help Wanted Issue or pull request requires extra help and feedback
Projects
None yet
Development

No branches or pull requests

2 participants