You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
` <p-tree
[value]="files"
class="w-full md:w-30rem"
selectionMode="single"
[(selection)]="selectedFile"
(onNodeSelect)="nodeSelect()" />
nodeSelect() {
console.log(this.selectedFile?.label);
}
`
You can find it here:
https://stackblitz.com/edit/hlj6vh-xevnpg?file=src%2Fapp%2Ftree-single-demo.ts
The text was updated successfully, but these errors were encountered: