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 is selected when selecting parent #16430

Closed
LouLeGrain opened this issue Sep 25, 2024 · 2 comments · Fixed by #16431
Closed

p-tree: Unselectable children is selected when selecting parent #16430

LouLeGrain opened this issue Sep 25, 2024 · 2 comments · Fixed by #16431
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@LouLeGrain
Copy link
Contributor

Describe the bug

If a node with a disabled children is selected and propagateSelectionDown is true by default, then the unselectable children are selected, without possibility to unselect them.

Enregistrement.de.l.ecran.2024-09-25.a.11.48.00.mov

Environment

Angular ^17.3.6 / PrimeNG ^17.18.0

Reproducer

https://stackblitz.com/edit/github-fos6jj?file=src%2Fapp%2Fapp.component.ts

Angular version

^17.3.6

PrimeNG version

^17.18.0

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

  1. Create a p-tree component with a node that has an unselectable children
  2. select parent node
  3. unselectable children node is selected

Expected behavior

Unselectable treenode should be unselectable, even when selecting parent node

@LouLeGrain LouLeGrain added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 25, 2024
LouLeGrain added a commit to LouLeGrain/primeng that referenced this issue Sep 25, 2024
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 26, 2024
@cetincakiroglu cetincakiroglu added this to the 17.18.11 milestone Sep 26, 2024
cetincakiroglu added a commit that referenced this issue Sep 26, 2024
Fix #16430 - p-tree: Unselectable children is selected when selecting parent
@SuRaMoN
Copy link

SuRaMoN commented Nov 22, 2024

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):
chrome_JyfaPxWT8x

If you remove the keys sicne this fix selection does not work, with keys, it does work.
image

Reason is that since this fix we are cloning nodes:
image

But without keys we do a full contents comparison that always fails:

Untitled

@SuRaMoN
Copy link

SuRaMoN commented Nov 22, 2024

i submitted a new issue for this: #16819

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants