react.dev
react.dev copied to clipboard
fix(scroll): #5995 keep computed height to avoid page jump
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