Text sizing only applies on resize #41
Labels
No labels
bug
dependencies
duplicate
enhancement
help wanted
invalid
investigation
question
release
spike
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: loke/ng2-fittext#41
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It doesn't apply unless I resize my browser window. Not sure why.
"ng2-fittext": "^1.2.12"
Same problem here, same situation. I tried everything but only when the screen is redrawn the resize will work.
Same for me...
I just had to remove it in the end I couldn't figure it out.
I got it working (the npmjs published version seems 8 months old rather than the master here)
I have simply copied the directive part to my project and the i used this sample code in a ionic 3 project (Angular 5):
I had to change the directive's constructor like this:
constructor(public el: ElementRef, public renderer: Renderer2) {This did not work for me by the way. As of today, the problem still exists on ionic v > 3.
You can trigger a window resize event with something like:
window.dispatchEvent(new Event('resize'));I found 2 ways that worked for me -
[modelToWatch]ngAfterViewInit -> setTimeout(less preferred)By design, just using activateOnResize=true should solve every problem, the font resizing will triggered when window size it's changed. Anyway, if you want to force-trigger the computation un can change the model passed as parameter to modelToWatch or as a workaround window.dispatchEvent(new Event('resize')) looks working fine.
See latest comment