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

Treeselect doesn't select the first node of the list #2372

Closed
flashboss opened this issue Oct 31, 2021 · 0 comments
Closed

Treeselect doesn't select the first node of the list #2372

flashboss opened this issue Oct 31, 2021 · 0 comments
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@flashboss
Copy link
Contributor

I report a strange behavior when selecting the first node in the list from a treeselect. It is not selected because there is a control in this function in the treeselct component:

     getSelectedNodes () {
         let selectedNodes = [];
         if (this.props.value && this.props.options) {
             let keys = this.props.selectionMode === 'single'? {[`$ {this.props.value}`]: true}: {... this.props.value};
             this.findSelectedNodes (null, keys, selectedNodes);
         }

         return selectedNodes;
     }

if this.props.value is equal to 0 it skips the action and thrones nothing. 0 is also a boolean in javascript. So that piece should be changed. Oddly, in the showcase I see it working. Is it possible to deepen?

flashboss added a commit to flashboss/primereact that referenced this issue Oct 31, 2021
@mertsincan mertsincan added the Type: Bug Issue contains a defect related to a specific component. label Nov 3, 2021
@mertsincan mertsincan added this to the 7.0.0.Final milestone Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

No branches or pull requests

2 participants