diff --git a/src/app/components/inputtextarea/inputtextarea.ts b/src/app/components/inputtextarea/inputtextarea.ts index c747db9f7ef..9279d9767a4 100644 --- a/src/app/components/inputtextarea/inputtextarea.ts +++ b/src/app/components/inputtextarea/inputtextarea.ts @@ -61,24 +61,15 @@ export class InputTextarea implements DoCheck { } resize(event?: Event) { - if (!this.cachedScrollHeight) { - this.cachedScrollHeight = this.el.nativeElement.scrollHeight; - this.el.nativeElement.style.overflow = "hidden"; - } - - if (this.cachedScrollHeight != this.el.nativeElement.scrollHeight) { - this.el.nativeElement.style.height = '' - this.el.nativeElement.style.height = this.el.nativeElement.scrollHeight + 'px'; + this.el.nativeElement.style.height = '' + this.el.nativeElement.style.height = this.el.nativeElement.scrollHeight + 'px'; - if (parseFloat(this.el.nativeElement.style.height) >= parseFloat(this.el.nativeElement.style.maxHeight)) { - this.el.nativeElement.style.overflowY = "scroll"; - this.el.nativeElement.style.height = this.el.nativeElement.style.maxHeight; - } - else { - this.el.nativeElement.style.overflow = "hidden"; - } - - this.cachedScrollHeight = this.el.nativeElement.scrollHeight; + if (parseFloat(this.el.nativeElement.style.height) >= parseFloat(this.el.nativeElement.style.maxHeight)) { + this.el.nativeElement.style.overflowY = "scroll"; + this.el.nativeElement.style.height = this.el.nativeElement.style.maxHeight; + } + else { + this.el.nativeElement.style.overflow = "hidden"; } this.onResize.emit(event||{});