This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Ethan Miller
Posted Jun 27 - Read on Facebook

Anyone know of a way to force a page reflow?


Jonas Treub

Do you mean a reload? If so: location.reload()

Ethan Miller

Thanks, but no, I mean triggering a page re-layout without reloading. For instance, once the fonts load and the text-metrics change you might want to reflow so all the css box sizes are recalculated.

I'm trying to run some user tests with a framer demo hosted on the web that includes webfonts. The fonts don't always load before the page is laid out in which case the box sizes are wrong.

There are a few ways to trigger this in Javascript, but they don't seem to be working for me in Framer.

Jordan Robert Dobson

Yes. You can just take a measured height of the text in mono space and then continually check until it changes the offset height. Then once there is a difference you can adjust it.

Ethan Miller

I'll try that Jordan! Thanks for another tip ;)

Read the entire post on Facebook