You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Block Inspector: Margin bottom applied to BaseControls affects layout of some components #49796
This issue summarizes a problem, as reported in #49520, where unintended margin bottom is applied to inner BaseControls components when the component is placed inside of the Block Inspector.
I first decided to access the public StoryBook page to find out which components encompass the BaseControls component.
I ran the following code in the browser console to apply margin-bottom when the BaseControls component was present and extract components with layout changes:
// If a BaseControl component is present in a StoryBook iframe document, apply a margin bottom to it.constiFrame=document.getElementById('storybook-preview-iframe');constdoc=iFrame.contentDocument;constbaseControls=doc.querySelectorAll('.components-base-control');if(!baseControls.length){console.log('No BaseControls component.');}else{console.log('BaseControls component exists: '+baseControls.length);doc.body.innerHTML+='<style>#root .components-base-control{margin-bottom: 24px!important;} .components-base-control{ border: 1px red solid;}</style>';}
I then actually injected those components into the Block Inspector to check if the layout was actually broken. As a result, I found that the following components are affected.
Affected components
These components have an internal BaseControl component and are always affected.
AnglePickerControl
ColorPicker
CustomGradientPicker
DateTImePicker (TimePicker)
GradientPicker
BorderBoxControl
BoxControl
Affected, but the layout is not broken
The following components apply margin-bottom to the internal BaseControl component but do not affect the layout at the component level.
BorderControl
FontSizePicker
RangeControl
Components with children
Components that can have children, such as PlaceHolder, TabPanel, etc., are all affected if a component is specified whose children include a BaseControl component.
Placeholder
What is your proposed solution?
Realistically, I believe that it is difficult to address all cases. I think it would be better to add a margin-reset selector like the one mentioned in this comment, limited to those that cause layout breakdowns at the component level.
I think this is about the bottom margin that Block Inspector explicitly adds, not the margins that used to be on the control components themselves. Related to #65191.
Activity
youknowriad commentedon Dec 24, 2025
I think @mirka removed the margin from most of these components. IS this issue still relevant?
mirka commentedon Dec 25, 2025
I think this is about the bottom margin that Block Inspector explicitly adds, not the margins that used to be on the control components themselves. Related to #65191.
fix DateTimePicker - workaround for WordPress/gutenberg#49796