Skip to content

Commit 5c2208c

Browse files
authored
fix(text-field): correctly check _initialHeight
TypeScript 3.7 flags the assignment on line 250 because `style.height` must not be `null`. The underlying reason though appears to be that the comparison checks against `=== undefined`, where the field only declares `null` as an option. The field is not initialized, so `undefined` is the correct value to compare to and type to use.
1 parent 27fae29 commit 5c2208c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cdk/text-field/autosize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {fromEvent, Subject} from 'rxjs';
3636
export class CdkTextareaAutosize implements AfterViewInit, DoCheck, OnDestroy {
3737
/** Keep track of the previous textarea value to avoid resizing when the value hasn't changed. */
3838
private _previousValue?: string;
39-
private _initialHeight: string | null;
39+
private _initialHeight: string | undefined;
4040
private readonly _destroyed = new Subject<void>();
4141

4242
private _minRows: number;

0 commit comments

Comments
 (0)