-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Block: Add button, label, and width options #24666
Conversation
Size Change: +1.81 kB (0%) Total Size: 1.17 MB
ℹ️ View Unchanged
|
There's a lot of options, but it actually feels pretty easy to use. I took a stab at some new icons (you can find them in Figma), opting to use less of the rounded rects: I wonder about the width and alignment options. I think maybe we could remove the Wide and Full options. I'd be nice to support a custom width similar to the Spacer block's height. |
@shaunandrews Icons now updated, and I've added support for resizing the width. |
f91bd77
to
69d9e9f
Compare
Marking this one as ready for review since all the editor and front end rendering is now working for button, label, and width options. I think separating color, border, and spacing settings into a separate PR makes sense? |
|
@shaunandrews The first three items should be fixed now. The minimum width is set at 220px. For the button to inherit the styles of the theme, I'd need to include the class |
I think the separators should be removed in the toolbar since these are all similar block level operations |
This is great! |
The unit input component should already allow to change to any unit (em, rem, vw, %) though it doesn't support more complex calculations. Once |
@mtias The image block converts the percentage into a pixel value when selected. I would expect if I selected a percentage value for this block that it would be an actual percentage for width. In this case it probably makes sense to remove the pixel width value when a percentage is selected, or remove a percentage selection when the width is manually adjusted. Thoughts? |
Or I suppose it could also change the unit input component to percentage. |
Yes :) |
@shaunandrews What would the reset button do on your graphic above? |
5797038
to
4b426ba
Compare
Rebased to fix merge conflicts. 👍 |
Pinging @afercia to check out and make sure all the variations here make sense, accessibility-wise. |
Thanks for the ping. I don't think WordPress should ever allow users to remove everything and produce an input field like the following one: which has no visual label, no button, no placeholder text, nothing that can visually identify this input like a search input. Instead, WordPress should make sure the content it produces is semantic and accessible. Giving so much power to users opens the door to potential abuse and I'm not sure this is okay. More importantly, when removing the label I would expect the I'll propose the accessibility team to discuss this change in the next weekly meeting. For now, I'd like to point out that I'm a bit disappointed this PR and the related issues weren't marked with the Accessibility label nor anyone pinged the accessibility team for some quick feedback. When changing important parts of the UI and especially anything related fo form controls an accessibility audit should be required. Not sure this is the best way to improve collaboration between teams. |
What is the expected behaviour when in "button only" mode? |
@scruffian Good point - Chandrika and I wondered the same thing, when working on the User documentation for it. Added new issue #27329 |
The idea was to follow up with a full screen or slide out search option using the button only mode, but this hasn't been done yet. For scenarios like including a search icon in a navigation block. |
@apeatling it felt like an artifact of a future idea. Maybe you can remove it for 5.6 and finish it after wards? |
Fixes #22071 (partially)
Closes #24643
Description
Update the search block to support:
How has this been tested?
Tested locally, all e2e tests passed.
Screenshots
Types of changes
New feature. I have tested upgrading from the previous version of the block, and all settings and visuals remain consistent.
Testing Instructions
Checklist: