-
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
Border control: missing labels #42095
Comments
See also #42118 (comment) Here's the breakdown of tasks. BorderControl
BorderBoxControl
|
Thanks for the breakdown @mirka 👍 I've created a couple of quick PRs hoping to address most of the tasks noted.
I'm happy to make any further changes we need, I'm just a little unclear on what exactly is required. |
Good question. What I understood from #42118 (comment) is that, users of speech recognition software (not screen reader) need to know the actual name of the form element so they can use voice commands to navigate to it. So even if they can visually perceive that a control is for the top border, and even if it's accessibly labeled, they don't use a screen reader so they need a way to visually tell what the actual label is. Tooltips aren't ideal because they still require the user to focus on the field first, but at least if they do it once they'll have a chance to learn what the label is and can use voice commands from then on. |
@mirka thanks, yes that's exactly the point. Tooltips aren't ideal but without them the only alternative for these users (who generally have some form of motor impairment) would be inspecting the source in the browser dev tools to discover the name of a control 🙁 |
A draft PR exploring tooltips for inner |
I've been digging around a bit with the border controls in the editor, and as has been mentioned elsewhere, I'm not entirely convinced that the current set up provides "a good and intuitive UX". Apologies for the following, potentially somewhat off-topic, brain dump! The initially presented view visually implies some sort of 'border' group, with an input labelled 'radius'... This association breaks down though with the addition of the border size and style control (which itself is somewhat confusingly labelled "border" in the pop-up tools menu). At this point, is 'border' still a group legend, or a label for the new field? This issue could potentially be resolved by adding a more explicit label to the size and style control, making it clear that "border" still applies to the group as a whole... The whole notion falls apart a bit though, because in reality 'border' is not a group legend but a header, and 'radius' isn't a label but a legend. This issue becomes particularly clear when 'radius' (for example) is unlinked to show four separate inputs. At this point, 'radius' ceases to be a label for a single control, and instead acts as a group heading. Here it is particularly unclear what the separate 'radius' fields are labelled as, and even though it is somewhat discoverable via tooltip, 'top left' doesn't actually mean much when taken out of isolation. |
Great breakdown of some of the issues around the border controls @andrewhayward 👍 I wonder if some lessons or inspiration can be taken from the latest iteration of our spacing controls. They now have a dropdown menu beside the property to select the desired side, axis, or "custom" configuration. Could something like that allow better labelling or use of fieldset/legend? After some very quick and dirty hacking in dev tools, it might look something like this: Obviously, there are some issues with the resulting screenshots above but they convey the basic idea. |
Additionally: labelling the input fields with icons isn't great from both an accessibility and usability perspective. It would be great to simply have visible label elements. |
Thank you @andrewhayward and @afercia for the feedback — I also agree that it would be good to have a more consistent and uniform set of controls dealing with the 4 sides of the box model. I'm going to cc @WordPress/gutenberg-design as this conversation may be particularly relevant. |
It's the four "corners": top, right, bottom, left.
I think leaning into this approach could be interesting. It's natural as we push forward in some areas to take those and apply them elsewhere. Worth exploring common patterns across these, as long as there's comprehension. We can have varying experiences for different controls, as long as they support the user. But I do think it's worth exploring on this front. |
Agreed. Another big benefit is that multiple controls can benefit from subsequent enhancements to the general pattern. One note: splitting padding/margin into horizontal/vertical by default serves common use cases that I'm not sure are shared by border. IE if we tried this, I'd consider the default control for border to manipulate all sides together, with options to select just one side, or custom for all sides. No linked top/bottom and left/right. |
Description
In the Border control, some form elements are unlabelled. There's nothing that gives these form elements a name so they will be announced by screen readers only with their type. Users won't have a clue what these form elements are meant for and they will be forced to explore the surrounding UI to figure it out.
Step-by-step reproduction instructions
repeat for the slider input (type=range) and observe it's unlabelled.
additionally: the 'Border color and style picker' button doesn't have a tooltip so its accessible name is not visible for users (think at speech recognition software users)
click the 'Unlink sides' button
there are now 4 input fields, each one for a border side
check their accessible name in the Chrome dev tools is empty
check there's actually a visually hidden
<label>
element but it's not associated with the input field: there's no for'id attributes association so the input fields are actually unlabelledadditionally: none of the 'Border color and style picker' buttons specifies whether it's for top, right, bottom, left
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: