Preserve block height during re-render to avoid content jumping #10164
Labels
General Interface
Parts of the UI which don't fall neatly under other labels.
[Type] Enhancement
A suggestion for improvement.
Problem
When a user changes some block controls, and the block needs to fetch new data from an API, the block's contents are replaced with a spinner. That changes the block's height, which can cause content jumping.
For example, if you have two tall blocks in a page, and you edit the bottom one, the height of the entire page will be drastically shorter, causing the viewport to jump up to the top of the page. Then, a second later, when the API request returns, the block height will be be restored to its previous height. You'll then have to scroll back down to return to the place you were before, so that you can see the changes and continue editing the block.
https://cloudup.com/cRnMfoye5CF
That capture shows an example of a custom block using SSR, but I was able to reproduce the same behavior with core blocks as well, like
Comments
.Possible Solution
I think the block height should be preserved, so that the user isn't interrupted, confused, and forced to scroll to get back to where they originally were.
Gutenberg 3.9.0
Firefox 63
The text was updated successfully, but these errors were encountered: