-
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
Improve block search input's accessible name and placeholder #28393
Conversation
Size Change: +16 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
Seems to work fine when testing on Windows/Mac. Thanks. |
@@ -167,7 +167,8 @@ function InserterMenu( { | |||
setFilterValue( value ); | |||
} } | |||
value={ filterValue } | |||
placeholder={ __( 'Search' ) } | |||
label={ __( 'Search' ) } | |||
placeholder={ __( 'Search for blocks and patterns' ) } |
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.
we can also search for reusable blocks, not sure if it counts as "blocks".
The placeholder change seems like a design decision, so let's try to get some opinions.
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 ping. You can indeed search for blocks, patterns, and reusable blocks.
However for brevity, I would think it okay to lump in reusable blocks with blocks, for a few reasons:
- Reusable blocks only show up when you first create one.
- When that happens, there's also a separate tab for it.
So in the name of brevity, this seems okay to try 👍 👍
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.
What I don't like personally is that sometimes there's no patterns... and "Search" is more generic. I don't want us to introduce conditions (so performance impact calling selectors) just to tweak the placeholder accurately. Isn't there another solution while still keeping the "Search" placeholder?
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.
Phrase-wise, plain old "Search" would be fine for me also. I'll defer if there's a technical underpinning to the change.
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.
@alexstine suggested "Search for blocks" on #26938 (comment). Since patterns are also collections of blocks and the button label is "Add block", it sounds generic enough, but still more descriptive than just "Search".
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.
I'm approving because I don't hold strong opinions.
My opinion though is the following:
- The placeholder doesn't have to be precise and "Search" is good and generic.
- The screen reader label need to be precise and would be good to have "blocks and patterns" in it.
I would be good with @youknowriad suggestion on leaving the placeholder the same and changing the screen reader label.
Looks like this label is already visually hidden, let's change the text. Thanks. |
Thanks for the suggestions folks! I'm leaving the placeholder as "Search" and changing only the label to something more descriptive ("Search for blocks and patterns"). |
This PR addresses a comment made by @alexstine on #26938 (comment).
Currently, the block search input has both a placeholder and a label, and both have the same value (
Search
on the block inserter on the top bar region, andSearch for a block
on the quick inserter next to the block, accessible with Shift+Tab). This PR changes it so their accessible name isSearch
, and the placeholder isSearch for blocks and patterns
, which is more descriptive.I'm open to suggestions as there may be better names.
How has this been tested?
Known issues
I noticed these issues on master, but this PR doesn't fix them:
I couldn't find any issues with NVDA.