-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BorderBlockControl component label is partially hidden by the input field #68772
Comments
Hey @gschaub, |
Below is the code to reproduce the issue. You can run it from the browser console: Codeconst { createElement: el, Fragment } = wp.element;
const { InspectorControls } = wp.blockEditor;
const { PanelBody, PanelRow, BorderBoxControl } = wp.components;
const { addFilter } = wp.hooks;
function withMyPluginControls( BlockEdit ) {
return function ( props ) {
return el(
Fragment,
{},
el(
InspectorControls,
{},
el(
PanelBody,
{
title: 'My Panel Body',
initialOpen: true,
},
el(
PanelRow,
{},
el( BorderBoxControl, {
label: 'My Border Control',
className: 'my-border-control',
} )
)
)
),
el( BlockEdit, props )
);
};
}
addFilter(
'editor.BlockEdit',
'my-plugin/with-inspector-controls',
withMyPluginControls
); Unfortunately, the block sidebar has several styles for laying out the controls that can sometimes cause unintended issues. I think this issue is related to #65191. It's not ideal, but for now the following CSS will work around it: .my-border-control {
width: 100%;
}
.my-border-control .components-base-control {
margin-bottom: 0;
} |
Hey @t-hamano, I tested the suggested workaround, and it’s working well: Should we raise a PR to include this style in the component? |
This style is only a temporary workaround and is probably not the best. Perhaps we should follow the suggestions in #65191 to explore a suitable approach. |
All - I have created a class called "border-box-workaround" and successfully applied the workaround. Thank you all for your help. I will continue to monitor this issue for the resolution. |
Description
I have created a BorderBoxControl for a custom block and the label is not visible (or only partially depending on configuration). Please see the screenshot. I have looked through the css in the Chrome Development Tools and it appears that the issue is related to container margins, but it all appears to be associated with the compenent itself. Additionally, my markup doesn't include any custom css.
Step-by-step reproduction instructions
Here is the applicable markup for the component. Note that the markup outside of the BorderBoxControl has been condensed: There are other Panel and PanelBody blocks.
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: