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

TreeNode: expanded does not work #7435

Open
nimo23 opened this issue Nov 19, 2024 · 1 comment
Open

TreeNode: expanded does not work #7435

nimo23 opened this issue Nov 19, 2024 · 1 comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant