Repository navigation
Image block: custom width/height can't be removed after the parent Group is switched to Row/Stack #84689
Description
Description
When an Image block has a custom width/height and its parent Group is switched to Row or Stack (flex), the image's Width/Height controls and resize handles are hidden (since #68666, see #69997). The saved width/height attributes are not cleared, though. They keep applying in the editor and on the front end, and nothing in the UI can remove them.
The image is stuck at a size the user can no longer see or edit. The only ways out are switching the parent back to Group, clearing the values and switching to Row/Stack again, or editing the block markup in the Code editor.
This is related to #69997 but is a separate problem: even if hiding the size controls in flex/grid layouts is intended, the hidden values shouldn't keep applying with no way to reset them. In the Dimensions panel menu there is no Width/Height item for the image, and "Reset all" is disabled.
In code: image.js swaps the Width/Height DimensionsTool for an aspect-ratio-only one when SIZED_LAYOUTS.includes( parentLayoutType ), and skips the ResizableBox for the same layouts. save.js still outputs is-resized and style="width:…;height:auto" from the attributes.
Expected: one of these:
- Clear
width/height(andscale) when the image ends up in a flex/grid parent, or - Keep a way to reset
width/heightin the Dimensions panel while they have a value, or - Ignore them in flex/grid layouts, so the rendered size matches the controls that are available.
Step-by-step reproduction instructions
- Add a Group block.
- Add an Image block inside it and pick an image.
- Set the image Width to
250pxin the block's dimension controls (or drag the resize handle). - Select the Group block and switch it to Row (or Stack).
- Select the image. The resize handles and the Width/Height fields are gone. Only the flex child size (Fit/Grow/Max/Fixed) and Aspect ratio are shown.
- Notice the image still renders at 250px.
- Open the Dimensions panel menu. There's no Width/Height item and "Reset all" is disabled.
- Open the Code editor. The block still has
"width":"250px"and theimghasstyle="width:250px;height:auto".
Screenshots, screen recording, code snippet
Image.Widt.stuck.in.Row.mp4
Environment info
- WordPress 7.1.3, Gutenberg plugin not installed
- Theme: Twenty Twenty-Five, no plugins active
- Browser: Brave 1.97 (Chromium 155) on macOS
The screen recording was made on a site with Astra and Spectra Blocks active (they add a few extra sidebar controls, e.g. responsive icons on Dimensions). I reproduced it again with all plugins deactivated and Twenty Twenty-Five, with the same result.
Please confirm that you have searched existing issues in the repo.
- Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- Yes
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Activity
Sourav61 commentedon Oct 14, 2026
Hey @ravigojiya , Thanks for reporting this!
I think the current behavior may be intentional. Preserving the Image block's existing width/height attributes when switching from Group to Row/Stack ensures that users don't lose their previously configured dimensions if they decide to switch back to the original Group layout.
Automatically clearing these attributes would remove that configuration, which could be undesirable.
Also, since Row/Stack layouts provide their own flex sizing controls, hiding the Image block's individual Width/Height controls seems consistent with the existing layout behavior.
That said, I think the main question is whether the preserved dimensions actually interfere with the flex sizing controls. If they don't, this seems more like an intentional attribute-preservation behavior than a functional bug.
Could you clarify whether you've observed any conflicts with the available flex sizing options, or whether the concern is primarily that the previously configured dimensions remain applied?