-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix: registerPlugin width issue #66725
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
t-hamano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Since the PanelRow component is a Flex layout, it is correct in the specs that the child width is not 100%. Applying 100% width for a BaseControl-based component will affect all extenders that use the PanelRow component.
I think the underlying problem is that the PluginPostStatusInfo forces the child to be surrounded by the PanelRow component.
Until WP 6.5, the summary panel was a Panel component, so this may have made sense:
But the current summary panel is not composed of the Panel component.
We might be able to consider removing the PanelRow wrapper in the PluginPostStatusInfo instead of making changes directly to the Panel component.
tyxla
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@up1512001 thanks for the contribution! However, I'm not sure I agree with this change.
First, I don't see why the Panel component needs to declare any specific styles for BaseControl - they just have nothing to do with each other. A better place to have this would be in a stylesheet that's related to the place where this usage manifests - for example, in the post editor sidebar, or inspector controls.
Second, if there's no core need for this, I'm not sure it makes sense to have it in the first place. It can actually regress existing use cases that rely on the fact that the field doesn't currently take 100% of the width.
Last, I'd expect this is something the custom plugin handles, by introducing additional styles. After all, for some plugin UIs it might make sense to take 100% of the width, and for others it may not, so I'd just prefer the components to be less opinionated about it.
| .components-base-control { | ||
| width: 100%; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be fair, I think this shouldn't live in the components package.
|
Thanks everyone for your feedback. In any case, it seems like this issue shouldn't be solved in the components package, so let's close this PR. Instead, we can move forward with #60515 to improve the documentation, or submit a PR for a different approach. |

What?
Fix the width issue for custom dropdown meta fields.
Why?
closes #66724
How?
added
100%width tocomponents-panel__rowchildcomponents-base-controlclass.Testing Instructions
gutenberg.phpfiletest.jsfile in same directory ofgutenberg.phpfile and add this build JS codewidth: 100%oncomponents-base-controlits cropping text and dropdown component is shrinkedScreenshots or screencast