Image Block: Fix inconsistent dimensions during selection #67507
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #67506
What?
Fixes inconsistent image dimensions in the Image block when selecting and deselecting the block. The image no longer changes size when interacting with it in the editor.
Why?
Currently, when selecting an image block, the dimensions temporarily change upon selection and deselection, causing an unwanted flickering effect. This creates a poor user experience and makes precise image sizing difficult. The issue occurs because the resizable container's dimensions are not consistently maintained across different interaction states.
Testing Instructions
Add a row or stack block to a page or post
Insert an image block within the row or stack.
Select the image block.
Observe any unexpected size changes when the image is selected.
Here's the pattern ( add an image to it )
Screencast
Before:
Screen.Recording.2024-12-03.at.09.10.28.mov
After:
Screen.Recording.2024-12-03.at.09.30.15.mov