Skip to content

Commit 0edd7f8

Browse files
author
Lorenzo Iovino
committed
quick fix resize height
1 parent c308b80 commit 0edd7f8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ng2fittext.directive.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export class Ng2FittextDirective implements AfterViewInit, OnInit {
3434
@HostListener('window:resize', ['$event'])
3535
onResize() {
3636
if(this.activateOnResize && this.fittext) {
37-
this.setFontSize(this.container.clientWidth);
37+
if(this.activateOnInputEvents && this.fittext) {
38+
this.setFontSize(this.container.clientHeight);
39+
} else{
40+
this.setFontSize(this.container.clientWidth);
41+
}
3842
this.ngAfterViewInit();
3943
}
4044
}

0 commit comments

Comments
 (0)