primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.58k stars 4.61k forks source link

p-tree: Selection does not work using the filter #12679

Open gpaschke opened 1 year ago

gpaschke commented 1 year ago

Describe the bug

Selecting a node on a filtered tree will always return the first tree node in $event using (onNodeSelect)="selectNode($event)" or [(selection)]

Environment

See below

Reproducer

https://stackblitz.com/edit/github-x5dcwr?file=src/app/app.component.html

Angular version

15.1.0

PrimeNG version

15.2.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

19.7.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Filter a tree
  2. Select any node except the first one
  3. Check the result of (onNodeSelect)="selectNode($event)"

Expected behavior

Selecting a node on a filtered tree should update the selected tree node [(selection)] (onNodeSelect) -> $event.

mastersys-giovanni commented 12 months ago

16.8 same

gbarrt20 commented 11 months ago

@mastersys-giovanni @gpaschke its because of this https://github.com/primefaces/primeng/issues/11418#issuecomment-1098225766

missing key for node