Skip to content

Commit 5e5aae3

Browse files
crisbetoandrewseguin
authored andcommitted
refactor(text-field): make constructor parameters required (#10431)
Makes the `_ngZone` parameter in `CdkTextareaAutosize` a required one. This was intended as a deletion target, but we hadn't set up deletion targets when it was added. BREAKING CHANGES: * The `_ngZone` parameter in the `CdkTextareaAutosize` constructor is now required.
1 parent 8bc7ee9 commit 5e5aae3

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/cdk/text-field/autosize.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ export class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
6464
constructor(
6565
private _elementRef: ElementRef,
6666
private _platform: Platform,
67-
private _ngZone?: NgZone) {}
68-
69-
// TODO(crisbeto): make the `_ngZone` a required param in the next major version.
67+
private _ngZone: NgZone) {}
7068

7169
/** Sets the minimum height of the textarea as determined by minRows. */
7270
_setMinHeight(): void {
@@ -92,13 +90,11 @@ export class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
9290
if (this._platform.isBrowser) {
9391
this.resizeToFitContent();
9492

95-
if (this._ngZone) {
96-
this._ngZone.runOutsideAngular(() => {
97-
fromEvent(window, 'resize')
98-
.pipe(auditTime(16), takeUntil(this._destroyed))
99-
.subscribe(() => this.resizeToFitContent(true));
100-
});
101-
}
93+
this._ngZone.runOutsideAngular(() => {
94+
fromEvent(window, 'resize')
95+
.pipe(auditTime(16), takeUntil(this._destroyed))
96+
.subscribe(() => this.resizeToFitContent(true));
97+
});
10298
}
10399
}
104100

0 commit comments

Comments
 (0)