-
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
SearchControl: remove margin overrides and add new opt-in prop #46081
Conversation
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: +66 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
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.
Code changes LGTM and test well as per the instructions 🚀
We can merge one that (tiny) comment has been addressed :)
Thank you @brookewp for working on this — I really appreciate the clarity of your instructions, it made the reviewing process much easier and it will give anyone stumbling upon your PR a very clear context of the changes!
For TemplatePartSelectionModal
! Note: I think it looks better with a smaller margin to match the top, but in this PR I've added padding to make it look the same as before. I'd be happy to remove it, though, if anyone agrees.
I don't personally have a strong option either way, so I'd say that your proposed solution looks good!
Unrelated to the changes in this PR, but — while testing for this change I noticed that the search bar's parent element doesn't span the whole width of the modal, which means that if scroll down the content of the modal and then hover over a pattern, the focus ring shows to the side of the search bar. Definitely something minor and not for this PR, but I though I'd flag it for a potential follow-up.
padding: 0 $grid-unit-20; | ||
} | ||
|
||
|
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.
Spacing nit: I don't think we need this empty line?
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.
Agreed! That was unintentional but is fixed now. :) Thank you!
e81d04e
to
020f6dd
Compare
…ress#46081) * SearchControl: remove margin overrides and add new opt-in prop * remove extra line and padding from TemplatePartSelectionModal to match approved proposed solution
What?
Added new opt-in prop
__nextHasNoMarginBottom
for useages ofSearchControl
in the Gutenberg codebase and removed margin overrides.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 removing margin overrides in the CSS and adding the prop
__nextHasNoMarginBottom
.Testing Instructions
Testing steps done in the block editor:
For
InserterMenu
For
QuickInserter
! Note: Currently, the border around the quick inserter is broken due to the added margin (see gaps in border on left and right side of search). The change here will fix it.
PatternsExplorerSearch
For
BlockManager
Testing steps done in the site editor:
For
TemplatePartSelectionModal
! Note: I think it looks better with a smaller margin to match the top, but in this PR I've added padding to make it look the same as before. I'd be happy to remove it, though, if anyone agrees.
For
SuggestionList
! Note:For this, you need to have at least 10 or more categories / authors / tags etc or you could edit the following line 127 to have a length greater than 0:
if ( ! showSearchControl && suggestions?.length > 9 ) {
For
ScreenBlockList