Open mattyrob opened 3 years ago
Hi @mattyrob, thanks for the code snippet. It made testing this easy. It turns out the widths are progressive because those labels happen to be of progressive lengths. See this screenshot where I made the first label longer and the second shorter.
This does seem like an styling oversight and it could warrant a tweak to the component styles in Gutenberg. To workaround a bit of CSS could be added to the editor styles of your block. I think the simplest bit of css would be:
.my-block-panel .components-base-control {
flex: 1;
}
The .my-block-panel
in the selector is just to make sure it wouldn't somehow have side effects in other parts of the UI. Of course, it'd have to be added in the PanelBody
props.
@stokesman
Thanks for the tip, I'll work on fixing this issue in my code with some CSS.
Description
The sidebar inspector seems to implement TextControls that get progressively wider
This issue seems visually worst in Chrome, is slightly better in Safari and hardly noticeable in Firefox. (Screen grab below is from Safari)
Step-by-step reproduction instructions
Deploy a block with multiple TextCrontol elements.
Expected behaviour
Text Controls should all be the same width
Actual behaviour
TextControls get progressively wider further down the page.
Screenshots or screen recording (optional)
Code snippet (optional)
WordPress information
Device information