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

TreeTable: node expanded property does not work #7435

Open
nimo23 opened this issue Nov 19, 2024 · 4 comments
Open

TreeTable: node expanded property does not work #7435

nimo23 opened this issue Nov 19, 2024 · 4 comments
Labels
Type: Bug Issue contains a defect related to a specific component.

Comments

@nimo23
Copy link

nimo23 commented Nov 19, 2024

Describe the bug

According to #606, we should use expandedKeys to expand the nodes by default.

But according to https://primereact.org/treetable/#api.TreeNode, we can also set expanded property when setting a TreeNode, for example:

const myNode: TreeNode = {
    id: myId,
    key: myId,
    label: myLabel,
    data: { name: name, type: "task" },
    icon: 'pi pi-fw pi-inbox',
    expanded: true, // DOES NOT WORK
    children: [{
        id: "child1",
        key: "child1",
        label: "chld",
        data: { name: "child1" },
        icon: 'pi pi-fw pi-inbox',
        expanded: true,
        children: []
    }]
};

However, after setting to myNode.expanded = true, the node is not expanded.

Reproducer

No response

System Information

"primereact": "^10.8.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",

Steps to reproduce the behavior

No response

Expected behavior

Make TreeNode#expanded work.

@nimo23 nimo23 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 19, 2024
@nimo23
Copy link
Author

nimo23 commented Nov 27, 2024

TreeMenu also has an expanded property and if you set this to true, it will expand correctly. However, TreeNode.expanded does not work.

@melloware
Copy link
Member

@melloware melloware added Resolution: Cannot Replicate Issue could not be replicated by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jan 2, 2025
Copy link

github-actions bot commented Jan 2, 2025

We're unable to replicate your issue, if you are able to create a reproducer or add details please edit this issue. This issue will be closed if no activities in 20 days.

@melloware
Copy link
Member

Oh i see it works for Tree based items you mean TreeTable only. It works for all other trees. I updated your title.

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Resolution: Cannot Replicate Issue could not be replicated by Core Team labels Jan 2, 2025
@melloware melloware changed the title TreeNode: expanded does not work TreeTable: node expanded property does not work Jan 2, 2025
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