bug(mat-tree): How to maintain tree expansion state if TreeControl is deprecated? #30258
Open
1 task done
Labels
needs triage
This issue needs to be triaged by the team
Is this a regression?
The previous version in which this bug was not present was
pre v18.2.0
Description
Previously, it was possible to maintain the expansion state independent of the MatTree (rendered) component by using a TreeControl.
With TreeControl deprecated, this does not appear possible any longer.
I rely on this feature so would appreciate consideration of a path forward.
Of note, the selection model is maintained privately in MatTree:
components/src/cdk/tree/tree.ts
Lines 366 to 372 in b961966
Note that this is not a duplicate of #29856, which looks to relate to accessing some of the methods of TreeControl, which have been made available on MatTree itself.
Reproduction
I can produce a reproduction but I believe the regression has been clearly explained above and a reproduction does not add value.
Expected Behavior
There is a mechanism for maintaining expansion state independent of the rendered component.
Actual Behavior
Expansion state is lost when the component is destroyed.
Environment
The text was updated successfully, but these errors were encountered: