Ionic view caching with NgFitText

Any one else have any issues using NgFitText when ionic view caching is turned on? It works 90% of the time but occasionally the text will shrink to a tiny font even with plenty of width in the surrounding div. I haven’t been able to get screenshots because it happens randomly.

Or alternatively does anyone have any other libraries or techniques for handling dynamic font sizing?

Given that this thread is the only one showing up when searching for ngFitText in the forum and me actually experiencing the same problem… :smile:

The reason it happens only sometimes and thus difficult to reproduce is because it has to do with the resize event, one which is triggered (unsure why) when you open/close a popover in Ionic. Elements in other cached views that are already fitted loose their height and width so ngFitText has a problem with the ratio calculation.

Have a look at this pull request I sent in on the ngFitText project: https://github.com/patrickmarabeas/ng-FitText.js/pull/36
Things are going a little bit slow over there, so I’m currently patching on my own.

Hope it’ll help you too.

1 Like

Fixed the same problem for me. Thanks for the PR ! Now let’s hope they merge it in…

1 Like