STRML / textFit

A jQuery-free component that quickly fits single and multi-line text to the width (and optionally height) of its container.
https://textfit.strml.net
643 stars 122 forks source link

Doesn't work properly in Safari #28

Closed KevinMars closed 7 years ago

KevinMars commented 7 years ago

It works only half the time in safari,

STRML commented 7 years ago

What about the other half the time?

On Jul 13, 2017 9:14 PM, "Kevin Mardakhayev" notifications@github.com wrote:

It works only half the time in safari,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/STRML/textFit/issues/28, or mute the thread https://github.com/notifications/unsubscribe-auth/ABJFP2agvv2aaBeYUBrygPRm8glCryNlks5sNs8VgaJpZM4OXv6w .

KevinMars commented 7 years ago

Thanks for getting back to me.

Sorry, I should be more clear. Textfit doesn't work properly when the page first loads but when something is clicked on the page and textfit is called again then it works fine. By properly, I mean it enlarges the text but not nearly enough to fit the div.

Please see this url for an example, [edited out]

Problem exists on safari, not on firefox or chrome

KevinMars commented 7 years ago

Hi I fixed the problem by wrapping it in a window.onload() function. I removed the url because I want to keep it private for now, but if you want to see the problem in action let me know. Thanks!