react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

fix(scroll): #5995 keep computed height to avoid page jump

Open ssan93 opened this issue 1 year ago • 3 comments
trafficstars

Closes #5995

Issue When the iframe gets out of range, it unmounts to save memory. While scrolling on desktop widths (vertical layout), the iframes are unmounting and their height gets reduced. This causes page jump as the previous content gets shorter.

Solution By keeping the calculated height value of the iframe, we can set the height of the iframe wrapper to prevent shrinking and remove the page jumps.

https://github.com/user-attachments/assets/eccc0485-b989-443c-8aad-9c125f377cbf

Untitled

ssan93 avatar Sep 07 '24 04:09 ssan93