From 0edd7f854a6887ad2092a9aca0294ccd0b2f8f8f Mon Sep 17 00:00:00 2001 From: Lorenzo Iovino Date: Mon, 22 May 2017 12:40:22 +0200 Subject: [PATCH] quick fix resize height --- src/ng2fittext.directive.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ng2fittext.directive.ts b/src/ng2fittext.directive.ts index 4632333..9fdcbc0 100644 --- a/src/ng2fittext.directive.ts +++ b/src/ng2fittext.directive.ts @@ -34,7 +34,11 @@ export class Ng2FittextDirective implements AfterViewInit, OnInit { @HostListener('window:resize', ['$event']) onResize() { if(this.activateOnResize && this.fittext) { - this.setFontSize(this.container.clientWidth); + if(this.activateOnInputEvents && this.fittext) { + this.setFontSize(this.container.clientHeight); + } else{ + this.setFontSize(this.container.clientWidth); + } this.ngAfterViewInit(); } }