primefaces / community

Community Forum
0 stars 0 forks source link

p-tree selection bug #2000

Open vrjaroslav opened 4 months ago

vrjaroslav commented 4 months ago

Discussed in https://github.com/orgs/primefaces/discussions/1962

Originally posted by **vrjaroslav** May 17, 2024 Hi, I found bug on component Tree. The issue start in the version 17.3.1. The problem is the in method onNodeSelect. In that method is console.log for print selected note ([(selection)]), but it prints previously selected node and not currently selected node. So if I click on Node1, then it print undefined, then if I click on Node2, then it print Node1. In version 17.3.0 the behaviour is right, so if I click on Node1, then it print in method onNodeSelect exactly Node1 as selected node ` nodeSelect() { console.log(this.selectedFile?.label); } ` You can find it here: [https://stackblitz.com/edit/hlj6vh-xevnpg?file=src%2Fapp%2Ftree-single-demo.ts](https://stackblitz.com/edit/hlj6vh-xevnpg?file=src%2Fapp%2Ftree-single-demo.ts)