@angular/cdk 18.2.3 → 18.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/fesm2022/tree.mjs CHANGED
@@ -555,9 +555,16 @@ class CdkTree {
555
555
  view.context.$implicit = newData;
556
556
  }
557
557
  });
558
- // TODO: change to `this._changeDetectorRef.markForCheck()`, or just switch this component to
559
- // use signals.
560
- this._changeDetectorRef.detectChanges();
558
+ // Note: we only `detectChanges` from a top-level call, otherwise we risk overflowing
559
+ // the call stack since this method is called recursively (see #29733.)
560
+ // TODO: change to `this._changeDetectorRef.markForCheck()`,
561
+ // or just switch this component to use signals.
562
+ if (parentData) {
563
+ this._changeDetectorRef.markForCheck();
564
+ }
565
+ else {
566
+ this._changeDetectorRef.detectChanges();
567
+ }
561
568
  }
562
569
  /**
563
570
  * Finds the matching node definition that should be used for this node data. If there is only