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 selection bug #2000

Open
vrjaroslav opened this issue May 22, 2024 Discussed in #1962 · 0 comments
Open

p-tree selection bug #2000

vrjaroslav opened this issue May 22, 2024 Discussed in #1962 · 0 comments

Comments

@vrjaroslav
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant