quick fix activateOnInputevent

This commit is contained in:
Lorenzo Iovino 2017-05-22 12:29:03 +02:00
parent ff241b1969
commit 191ea5102d

View file

@ -49,8 +49,11 @@ export class Ng2FittextDirective implements AfterViewInit, OnInit {
ngOnInit() { ngOnInit() {
if (this.fittext) { if (this.fittext) {
this.setFontSize(this.container.clientWidth); if(this.activateOnInputEvents) {
this.el.nativeElement.style.setProperty('will-change', 'content'); this.setFontSize(this.container.clientHeight);
} else {
this.setFontSize(this.container.clientWidth);
this.el.nativeElement.style.setProperty('will-change', 'content');
} }
} }