Skip to content

Commit 86ffa33

Browse files
author
Ales Rechtorik
committed
change innerHTML to value
1 parent ce71c6c commit 86ffa33

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
@@ -160,7 +160,7 @@ export class MdAutosize implements OnInit {
160160
}
161161

162162
private _getLineHeight(): number {
163-
const el: HTMLElement = this._elRef.nativeElement;
163+
const el: HTMLTextAreaElement = this._elRef.nativeElement;
164164

165165
// get the actual computed styles for the element
166166
const computedStyles = window.getComputedStyle(el);
@@ -172,7 +172,7 @@ export class MdAutosize implements OnInit {
172172
}
173173

174174
// create temporary element
175-
const tempEl = document.createElement(el.nodeName);
175+
const tempEl = <HTMLTextAreaElement>document.createElement(el.nodeName);
176176

177177
// reset styling, visually hiden the element
178178
// and set its font styles to match the ones of our textarea
@@ -190,7 +190,7 @@ export class MdAutosize implements OnInit {
190190
);
191191

192192
// fill in one row
193-
tempEl.innerHTML = '-';
193+
tempEl.value = '-';
194194

195195
// append to parent element to correctly inherit same values
196196
// as the actual textarea

0 commit comments

Comments
 (0)