primereact
primereact copied to clipboard
Tree: Bad initialization of expanded keys when filter option is present
Describe the bug
The initial value given to expandedKeys gets overridden if a filter field is present, even if the filter value is empty.
In the reproducer, both trees use the same initial expandedKeys but the tree with the filter field is not initialized properly (all nodes are collapsed).
Reproducer
https://stackblitz.com/edit/edubbxcg
System Information
primereact: 10.9.7
Steps to reproduce the behavior
No response
Expected behavior
Both trees should be the same upon first render.
It's not just about initialization, when changing the model all the nodes are collapsed if the filter is empty:
https://stackblitz.com/edit/edubbxcg-bpppr4jy
- Expand a node
- Click on 'Add item'
- All the nodes are collapsed
Thanks @RolT for posting this - I have the same issue.