LeaVerou / stretchy

Form element autosizing, the way it should be
https://stretchy.verou.me/
Other
1.27k stars 87 forks source link

Bad size on first load #6

Closed yukulele closed 7 years ago

yukulele commented 9 years ago

Because of font loading

press ctrl+F5 on project home page to see bug http://leaverou.github.io/stretchy/

(tested on Win 7 / Firefox & Chrome)

LeaVerou commented 9 years ago

Any chance for a screenshot? It’s hard for me to reproduce as I have the fonts installed...

yukulele commented 9 years ago

Of course!

capture d ecran 2015-07-28 a 13 26 25

yukulele commented 9 years ago

Font load detection seem to not be easy Only Chrome support font load event http://caniuse.com/#feat=font-loading

Other font load detection hack: http://smnh.me/web-font-loading-detection-without-timers/

LeaVerou commented 9 years ago

Shit. Thanks for the report, I'll look into it!

dobrud commented 7 years ago

I've also run into the same issue. It seems like the initialisation on DOMContentLoadad is too early, as at this stage the fonts may not be loaded yet. The issue seems fixed for me when I rerun Stretchy.resizeAll() on the document load event.