Commit f2d1364
committed
fix: force expand all tree nodes on data updates
The tree component automatically collapses whenever the data updates.
This happens because `defaultOpened` only works on the first load, and
the library loses the expansion state when treeData receives new objects
from useMemo.
Added a useEffect that runs a recursive function to force open all
nodes and their children every time treeData changes. This ensures the
tree stays fully expanded even after data refreshes.
Signed-off-by: Jasmina <jasmina.piric@secomind.com>1 parent bbcd3d0 commit f2d1364
1 file changed
Lines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
441 | | - | |
442 | 441 | | |
443 | 442 | | |
444 | 443 | | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
445 | 461 | | |
446 | 462 | | |
447 | 463 | | |
| |||
0 commit comments