Skip to content
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

A11y keyboard focus control in the Input example #3585

Closed
DaveBest99 opened this issue Mar 13, 2017 · 6 comments · Fixed by #4600
Closed

A11y keyboard focus control in the Input example #3585

DaveBest99 opened this issue Mar 13, 2017 · 6 comments · Fixed by #4600
Assignees
Labels
Accessibility This issue is related to accessibility (a11y) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@DaveBest99
Copy link

Bug, feature request, or proposal:

Bug:
Using JAWS with browsers Firefox, Chrome, and IE11, reveals focus issues most likely due to disassociated "label" and "input" elements. Note, the "input" element has a blank "aria-describedby= " attribute.

What is the expected behavior?

Text labels must be associated with the Form element, and default text should be spoken.

What is the current behavior?

Currently, some Edit Input fields have no text labels shown on the braille display, and there is no error detection.

What are the steps to reproduce?

See below.

What is the use-case or motivation for changing an existing behavior?

To allow for WCAG standards.

Which versions of Angular, Material, OS, browsers are affected?

Latest.

Is there anything else we should know?

The screen reader user experience is as follows:

  1. Press Tab key into the component.
    JAWS focus moves past the "Company" disabled Edit filed and to the first focusable element.
    JAWS says "First name edit" and braille display shows "First name ed".
    User can type multiple words in this Edit field without getting an error message.

  2. Press Tab key to the next element.
    JAWS says "Long Last Name That Will Be Truncated edit", and the braille display shows "Long Last Name That Will Be Truncated ed".
    The user can type multiple words in this field.
    Note, when using Firefox, pressing Tab key forward will move focus to this field once, but pressing Shift+Tab key back through the input elements will display this Edit field twice if the Edit field is blank.

  3. Press Tab key again.
    JAWS says "Address edit" (does not announce the input text), but the braille display only shows the input text and not the text label "1600 Amphitheatre Pkwy".
    JAWS does announce "contains text" if the input field has text.
    If the input Edit field is blank, then the braille display is blank (no text label appears).
    Note, when using IE11, the default Edit filed text "1600 Amphitheatre Pkwy" does not appear on the braille display (it is blank until the user types something), thus the user never sees the default text.

  4. Press Tab key again.
    JAWS says "Address 2 edit", and the braille display is blank (no Edit field text "Address 2" label appears).

  5. Press Tab key again.
    JAWS says "City edit", and the braille display shows "City ed".
    As expected.

  6. Press Tab key again.
    JAWS says "State edit", and the braille display shows "State ed".
    As expected.

  7. Press Tab key again.
    JAWS says "Postal Code edit 94043 5 / 5", and the braille display shows "Postal Code ed 94043 5 / 5".
    If the user deletes the default Edit field text, presses Tab key away and then Shift+Tab key back, JAWS says "Postal Code edit 0 / 5", which is also shown on the braille display.
    If the user types characters into the Edit field "abc", then JAWS will say and display "Postal Code edit abc 3 / 5" (no error message announced).
    Note, the number of characters in the Edit filed does not get updated unless the user moves focus away from the Edit field and then back again (it may not be clear to the user as to the purpose of these numbers).
    Note, when using IE11 and unlike the Address field, the default text "94043" is announced and displayed by JAWS.

@mmalerba mmalerba self-assigned this Mar 14, 2017
@mmalerba mmalerba added P2 The issue is important to a large percentage of users, with a workaround Accessibility This issue is related to accessibility (a11y) labels Mar 14, 2017
@mmalerba
Copy link
Contributor

This issue covers a number of things:

  1. Blank aria-describedby - created fix(input): fix blank aria-describedby #3713 to fix
  2. Duplication of tab stops in Firefox - unable to reproduce
  3. Textarea text not read by screen reader - seems to be how JAWS handles textareas, saw same behavior w/ native one
  4. Textarea initially blank in IE - This is caused by a core bug (Textarea element in form when binding model has initial state as dirty in IE angular#14440), but we should update the example to work around it until its fixed.
  5. Various a11y issues with the examples themselves

Since 1-4 have some resolution or another issue tracking them, I will re-purpose this issue for tracking 5

@mmalerba mmalerba changed the title A11y keyboard focus control in the Input Component A11y keyboard focus control in the Input example Mar 21, 2017
@mmalerba mmalerba added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed P2 The issue is important to a large percentage of users, with a workaround labels Mar 21, 2017
@DaveBest99
Copy link
Author

DaveBest99 commented Mar 22, 2017 via email

@mmalerba
Copy link
Contributor

The code for md-input-container actually automatically adds a label based on the placeholder. For example it transforms

<md-input-container class="demo-full-width">
  <textarea mdInput placeholder="Address">1600 Amphitheatre Pkway</textarea>
</md-input-container>

into something like this

<md-input-container class="demo-full-width">
  <textarea mdInput placeholder="Address" id="input1">1600 Amphitheatre Pkway</textarea>
  <label for="input1">Address</label>
</md-input-container>

I tried some various ways of labeling the textarea (see below) but it didn't make a difference in how JAWS read it. I think JAWS assumes textarea content will be too long and doesn't bother to read it all when you tab to the element.

<textarea placeholder="cool label">some content</textarea>

<textarea placeholder="cool label" id="test1">some content</textarea>
<label for="test1">cool label</label>

<textarea placeholder="cool label" aria-labeledby="test2">some content</textarea>
<label id="test2">cool label</label>

<textarea placeholder="cool label" aria-labeledby="test3" id="test4">some content</textarea>
<label id="test3" for="test4">cool label</label>

<textarea aria-labeledby="test5" id="test6">some content</textarea>
<label id="test5" for="test6">cool label</label>

@DaveBest99
Copy link
Author

DaveBest99 commented Mar 22, 2017 via email

@mmalerba
Copy link
Contributor

I tried adding role="textbox" aria-multiline="true" as well (though I don't think they should be necessary, the screen reader should know that it's the default role for this element). Didn't have any effect

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants