13 lines
352 B
TypeScript
13 lines
352 B
TypeScript
//https://forum.ionicframework.com/t/elastic-ion-textarea/55671/4
|
|
import {HostListener, Directive} from '@angular/core';
|
|
|
|
@Directive({
|
|
selector: '[elastic]'
|
|
})
|
|
export class Elastic {
|
|
@HostListener('input',['$event.target'])
|
|
onInput(nativeElement: any): void {
|
|
nativeElement.style.height = nativeElement.scrollHeight + "px";
|
|
}
|
|
}
|