-
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
ComboboxControl: add new opt-in prop #45796
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +37 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
Hey @brookewp 👋 Thank you for working on this! I just had a quick question — the PR description mentions “...replacing margin overrides with new opt-in prop…”, but looking at the code changes, I don't see any CSS margin override being removed — is that on purpose? |
Good question @ciampo! I had copied the title/description from my other related PR for consistency, but it isn't happening here, so it's unclear. I'll update the title now! |
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.
Looks good 🚢
92985c2
to
2e4d99c
Compare
What?
Adding new opt-in prop
__nextHasNoMarginBottom
to usages ofComboboxControl
in the Gutenberg codebase.Why?
Part of this project: #38730
The tl;dr is
BaseControl
has amargin-bottom
which makes it difficult to reuse and results in inconsistent use.How?
By adding the prop
__nextHasNoMarginBottom
.Additional Notes
There is a bottom margin for
UserControl
in trunk. However, this is causing inconsistent spacing, so I believe this is a positive change. Here you can see how the title has no margin above and touches the padding. Whereas, at the bottom it has extra space (other sections aren't like this). See the orange outline below the text and above the padding to see the inconsistent margin that is removed in this PR:Testing Instructions
To test this, you'll need to look for the following
ComboboxComponent
(dropdowns) and ensure that the margin is the same as before (margin-bottom
of 0) for thediv
with classcomponents-base-control__field
. Screenshots below are how it looks in core right now.Before going through the steps, ensure you have at least two published pages and then you can complete all the steps from a single page editor.
For
UserControl
For
PostAuthorEdit
(block library)For this to work, you need at least 25 editors on the site (same with the component below). Or you can edit line 26
const minimumUsersForCombobox = 25;
and change the value 25 to 1 inpackages/block-library/src/post-author/edit.js
. Then:For
PostAuthorComboBox
(editor)For this to work, you need at least 25 editors on the site. Or you can edit line 14
const minimumUsersForCombobox = 25;
and change the value 25 to 1 inpackages/editor/src/components/post-author/index.js
. Then:For
PageAtttributesParent