We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b3c42e commit 22ed4beCopy full SHA for 22ed4be
src/cdk/tree/tree.ts
@@ -1061,6 +1061,12 @@ export class CdkTree<T, K = T>
1061
renderNodes: readonly T[];
1062
flattenedNodes: readonly T[];
1063
}> {
1064
+ // clear previously generated data otherwise it is always retained in addition to new data
1065
+ // calling clear() manually removes all key pair values allowing retained data to be
1066
+ // garbage collected.
1067
+ this._parents.clear();
1068
+ this._ariaSets.clear();
1069
+ this._levels.clear();
1070
// The only situations where we have to convert children types is when
1071
// they're mismatched; i.e. if the tree is using a childrenAccessor and the
1072
// nodes are flat, or if the tree is using a levelAccessor and the nodes are
0 commit comments