gutenberg
gutenberg copied to clipboard
Spacer block: Fill vertical space when within a Row block
When added as a direct child to a Row block, I'd expect the Spacer block to fill the available space (height). That would make the block easier to select and manipulate.
Currently you need to find the exact 24px space to properly select the block.

Thanks for sharing the issue ! i have analysed issue and below is my proposed solution for it.
Modifications in styling ( style.css )
- We will add CSS rules targeting .is-layout-flex > .wp-block-spacer and .is-layout-grid > .wp-block-spacer.
- Set
align-self: stretch;to force the spacer to span the entire cross-axis of its flex/grid parent. - This ensures that in a Row block (horizontal flex), the spacer matches the row's height. In a Stack block (vertical flex), it matches the stack's width.
Modifications in Edit function of Spacer block
- In the
SpacerEditcomponent, there is a hardcodedheight: 24inline style applied wheninheritedOrientation === 'horizontal'. - We will change this logic so
heightevaluates toundefined( or removed ) if its inside a flex layout, or just remove the 24px hardcode, allowingalign-self: stretchfrom our css to take effect without being constrained by an inlineheight: 24pxlimit. - We will verify that the invisible clickable area (
::beforepseudo element in styling ) still functions properly or is no longer solely responsible for editability since the block itself will stretch.
Above is my implementation plan, if it looks good i would like to work on this issue and go ahead with PR for this issue