Skip to content

Commit 2387801

Browse files
author
Ales Rechtorik
committed
change innerHTML to value
1 parent 45c7c84 commit 2387801

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/input/input.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class MdAutosize implements OnInit {
164164
}
165165

166166
private _getLineHeight(): number {
167-
const el: HTMLElement = this._elRef.nativeElement;
167+
const el: HTMLTextAreaElement = this._elRef.nativeElement;
168168

169169
// get the actual computed styles for the element
170170
const computedStyles = window.getComputedStyle(el);
@@ -176,7 +176,7 @@ export class MdAutosize implements OnInit {
176176
}
177177

178178
// create temporary element
179-
const tempEl = document.createElement(el.nodeName);
179+
const tempEl = <HTMLTextAreaElement>document.createElement(el.nodeName);
180180

181181
// reset styling, visually hiden the element
182182
// and set its font styles to match the ones of our textarea
@@ -194,7 +194,7 @@ export class MdAutosize implements OnInit {
194194
);
195195

196196
// fill in one row
197-
tempEl.innerHTML = '-';
197+
tempEl.value = '-';
198198

199199
// append to parent element to correctly inherit same values
200200
// as the actual textarea

0 commit comments

Comments
 (0)