Skip to content

Commit c773d66

Browse files
committed
addressed comments
1 parent 5a45372 commit c773d66

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/lib/input/autosize.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ describe('MdTextareaAutosize', () => {
218218
const fixtureWithForms = TestBed.createComponent(AutosizeTextareaInATab);
219219
fixtureWithForms.detectChanges();
220220
textarea = fixtureWithForms.nativeElement.querySelector('textarea');
221-
expect(textarea.getBoundingClientRect().height).toBeGreaterThan(0);
221+
expect(textarea.getBoundingClientRect().height).toBeGreaterThan(1);
222222
});
223223

224224
it('should work in a step', () => {
225225
const fixtureWithForms = TestBed.createComponent(AutosizeTextareaInAStep);
226226
fixtureWithForms.detectChanges();
227227
textarea = fixtureWithForms.nativeElement.querySelector('textarea');
228-
expect(textarea.getBoundingClientRect().height).toBeGreaterThan(0);
228+
expect(textarea.getBoundingClientRect().height).toBeGreaterThan(1);
229229
});
230230
});
231231

src/lib/input/autosize.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,9 @@ export class MdTextareaAutosize implements AfterViewInit, DoCheck {
136136
}
137137

138138
ngDoCheck() {
139-
this.resizeToFitContent();
139+
if (this._platform.isBrowser) {
140+
this.resizeToFitContent();
141+
}
140142
}
141143

142144
/** Resize the textarea to fit its content. */

0 commit comments

Comments
 (0)