Answers for "resize() { this.elementRef.nativeElement.style.height = '4px'; this.elementRef.nativeElement.style.height = this.elementRef.nativeElement.scrollHeight + 'px'; }"

0

resize() { this.elementRef.nativeElement.style.height = '4px'; this.elementRef.nativeElement.style.height = this.elementRef.nativeElement.scrollHeight + 'px'; }

<textarea (keyup)="autoGrowTextZone($event)"></textarea>

autoGrowTextZone(e) {
  e.target.style.height = "0px";
  e.target.style.height = (e.target.scrollHeight + 25)+"px";
}
Posted by: Guest on January-06-2021

Browse Popular Code Answers by Language