Open nimo23 opened 3 days ago
According to https://github.com/primefaces/primereact/issues/606, we should use expandedKeys to expand the nodes by default.
expandedKeys
But according to https://primereact.org/treetable/#api.TreeNode, we can also set expanded property when setting a TreeNode, for example:
expanded
TreeNode
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.
myNode.expanded = true
No response
"primereact": "^10.8.4", "react": "^18.3.1", "react-dom": "^18.3.1",
Make TreeNode#expanded work.
TreeNode#expanded
Describe the bug
According to https://github.com/primefaces/primereact/issues/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 aTreeNode
, for example:However, after setting to
myNode.expanded = true
, the node is not expanded.Reproducer
No response
System Information
Steps to reproduce the behavior
No response
Expected behavior
Make
TreeNode#expanded
work.