-
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
Give editable fields better labels #1659
Comments
Closing in favor of #3412. (I think it is appropriate, but feel free to reopen and clarify.) |
Agreed to reopen. More details: See screenshot below: The main title is a special case, so let's ignore it for now. Instead, all the other editable regions use an aria-label attribute For example, landing on a paragraph screen reader users will hear: This is OK as a visual instruction, but doesn't tell anything useful to users. In a standard form, this would be the equivalent of, for example, a "first name" field with a label that doesn't say it's about the first name, and says instead Instead, the aria-label should identify what the Editable is. For a paragraph, it should say: |
This is even more important now that most of the editable fields use a |
This issue probably requires more triage or context because right now it's quite broad, but the gist of it is: we should use To start with: this issue could aim to clarify/reconcile the labels/placeholders of the following (RichText) blocks:
(We can always add more.) |
Agree #5981 was sort of a duplicate. Some recommendations made there should be taken into account though, especially #5981 (comment) It's not just about paragraph, list, and button. Here's a list of placeholder used also as aria-labels I've made a while ago (it may be out of date): audio button code cover image embed gallery heading image list paragraph preformatted pullquote / quote shortcode subheading text columns verse video All these values are used also as aria-label for the editable fields, which doesn't make sense for users. These values are more "suggestions" that should go in a description (see #5981 (comment)). Instead, each editable field should be labelled to communicate what it is, as one would normally do for form fields. E.g.: "Paragraph content". |
I'm pretty sure we can remove the word "probably" 🙂 To further clarify why these aria-label values are far from ideal, imagine:
Visually, this is equivalent to the following: The above is exactly what screen readers users perceive. As said, it applies to all the RichText instances listed above. Worth noting using a proper aria-label would help screen reader users but wouldn't entirely solve the problem. For example, speech recognition software users need the control name (i.e. label) to be visible to be able to voice commands and directly activate the control. In the case of RichText editable fields there's no visible label though. More details: |
@timwright12 labelling of the RichText field is still a problem, as the value used for These fields are the equivalent of a textarea ( Nothing new to add to the previous comment #1659 (comment) |
@afercia on it. |
@tofumatt @afercia Just so we're on the same page and we don't have to go back and forth in a PR about the actual Please let me know if these are OK to move forward with or if we think some of them need to be changed. Some guidance on "Text Columns" would be much appreciated as well. audio button code cover image embed gallery heading image list paragraph preformatted pullquote / quote shortcode subheading text columns (I couldn't find this one, but I'm sure I will) verse video Once we work out the actual content, the update should be relatively quick to implement. |
^
You mean..: |
@anevins12 yup, sorry about that (updated) |
I agree with the approach of using the (aria)label as the most useful information and the placeholder as supplementary information. It shouldn't matter if the placeholder text is not read out at all, but yes if it is then it shouldn't duplicate information for that field. |
Because there isn't yet a PR to review on this one, I'm moving this out of the 5.0 release milestone. I've moved it to the 5.0.x follow-up milestone for now. I think we can probably get this in a 5.0.x release; if it was ready for review today (or anytime before we release 4.5) I'd be happy to land it for WordPress 5.0 😄 |
@timwright12 Suggestions looks good. I'm not sure do we need word "here" though. |
@afercia What's the status of this one? Any actionable items? |
It doesn't look like there are really actionable items here that can be ported into Gutenberg when Gutenberg's desire is to mimic the frontend. Maybe closing this for now is okay. |
This issue has nothing to do with visual things that may impact the front end. It's about the way the various editable fields (including contenteditables) are labelled, in combination with their visual placeholders. I see something has changed in the meantime but still some fields are labelled improperly. Specifically, the Specifically, all the action verbs like "Add", "Write", etc should be removed. For some of the editable, they're still used even when users already entered some text. For example: In the screenshot above: though the block itself is correctly labelled as Screen readers will announce the editable as This is extremely confusing for users and not helpful at all. In a classic web form, this would be equivalent to labelling the form fields in the following way: which is arguably something no one would ever do. Reopening this issue for the second time, in the hope I've been finally able to clarify what this issue is about. |
My mistake. Thanks for reopening and updating it, @afercia. |
Splitting this out from #1477
Screen readers and other assistive technologies (for example speech recognition software) use the
aria-label
attribute to announce the name (the "accessible name") of UI controls to users.contenteditable
regions in the editor use anaria-label
attribute and a visible placeholder text with the same value. For example, a quote block uses aWrite quote…
text for both.One important thing to consider is that
contenteditable
regions tend to be reported by screen readers as sort of form fields. The behavior differs across screen readers but they understand it's an editable region. Thus, anaria-label
gets announced as it was the label of a form field:NVDA instead tends to announce as
editable
the actual HTML element, for example it announces:paragraph editable
for the text blocklist editable
for the list blocktext frame editable
for the button block (because it's a span)Regardless, it does announce the aria-label. So what happens, in a few words?
There's the risk the visible placeholder text is reported as content of the editable text, so hearing, for example:
Write label ... Write label
should be avoided. One option could be hiding the visible placeholder from assistive technologies witharia-hidden
.However, I'm not sure we should use
Write label…
,Write…
, etc., as aria-label in the first place. They behave like labels of a form field so they are announced even after users enter some content, for example:This could be confusing, as the aria-label text in this scenario is not so appropriate. Wondering how to improve the overall way editable regions are exposed to assistive technologies. Any feedback welcome!
The text was updated successfully, but these errors were encountered: