-
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
Search: Update search block to handle per corner border radii #33023
Conversation
Size Change: +93 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
@apeatling Do you think only partially applying border radii to the search block's input and button when the button is placed inside would negatively impact the expanding search block work? By partially applying border radii I mean something like the screenshots below. Note the lack of border radius on the input's right corners and the button's left corners. My thinking is the transition between the non-expanded view to the ones below might get a bit wonky? |
The transition is setting the width of the input field to zero, so it should be okay? The button would remain with the border radii set. |
Ok, thanks. My misunderstanding was that the expanding search input was going to be a separate option to the "button inside" positioning. If the expanding style means the button and input are separate, without a wrapper, then the application of the border radius styles isn't affected. |
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.
This is testing nicely for me following all the test steps @aaronrobertshaw!
✅ Continues to render existing search blocks with string-based attribute correctly in the editor and on the front end
✅ Updating an existing search block continues to use the string-based approach (since we haven't replaced the control yet)
✅ Blocks using the new object-based attribute are rendered correctly in the editor and on the front end of the site
✅ Switching themes to one that doesn't support the radius control still preserves the rendering of the radius values
I just left a comment about specificity in the naming of the added PHP function, but other than that, this one looks good to go, to me!
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 fixing up the function name @aaronrobertshaw! I just thought of another case from testing #31585 where corners might have valid null
values, so left another couple of comments. It might just need some extra checks before adding styles to neaten up the styles we're outputting?
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.
Nice refactor @aaronrobertshaw, this is testing well for me now, with no unexpected empty CSS attributes 👍
Just left a comment about potentially escaping the border radius $key
since we're concatenating it directly into an attribute. Though, I'm not sure if it's actually an issue with real-world usage, so it could be more theoretical. Apologies if it's too nit-picky!
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 fixing that up, this LGTM now! 👍 The failing e2e test appears unrelated to me (maybe a rebase might get it passing?).
Given it was just a timeout error to start with I re-ran the tests. The failing test then passed however another e2e test failed related to the widgets editor. There's a PR for addressing that I believe: #33066. It mentioned a possible order issue hence the intermittent nature of the failures. A final re-run of the tests had them all failing. I'll wait until tomorrow, then rebase/re-run tests as needed. |
The border radii are still applied in a 1:1 fashion to the corners of the input and button when the button is positioned inside. A future iteration might change this so input gets left corners only and button gets right corner values etc.
b040c8a
to
75350d9
Compare
I've made another update to this to ensure a deprecated numerical border radius value displays correctly in the editor. Previously, it was only correct on the frontend. The PR description, testing instructions and block code snippet have been updated. |
Thanks for updating this @aaronrobertshaw, I just gave it another test, and it's still working correctly for me, with the addition of now handling the deprecated numeric based border radius 👍 |
Related: #31585 & #33017
Description
Updates the Search block's ad hoc application of border radius block support styles to handle individual border radii for each corner.
The border radii are still applied in a 1:1 fashion to the corners of the input and button when the button is positioned inside. A possible future iteration might be to change this so the input gets left corner values only and button gets right corner values.
How has this been tested?
Manually.
Screenshots
Types of changes
Bug fix.
(Prevents issue with per-corner border radius block support that will occur when UI PR update lands)
Checklist:
*.native.js
files for terms that need renaming or removal).