mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(tree) make change detection less often (#11103)
This commit is contained in:
committed by
Joey Perrott
parent
f130eadb09
commit
e59d0fb447
@@ -607,6 +607,8 @@ describe('CdkTree', () => {
|
||||
flush();
|
||||
} catch {
|
||||
flush();
|
||||
} finally {
|
||||
flush();
|
||||
}
|
||||
}).toThrowError(getTreeControlFunctionsMissingError().message);
|
||||
}));
|
||||
|
||||
@@ -287,6 +287,8 @@ export class CdkTree<T> implements CollectionViewer, OnInit, OnDestroy {
|
||||
viewContainer.move(view!, currentIndex);
|
||||
}
|
||||
});
|
||||
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -336,7 +338,5 @@ export class CdkTree<T> implements CollectionViewer, OnInit, OnDestroy {
|
||||
if (CdkTreeNode.mostRecentTreeNode) {
|
||||
CdkTreeNode.mostRecentTreeNode.data = nodeData;
|
||||
}
|
||||
|
||||
this._changeDetectorRef.detectChanges();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user