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

live region recommendations #4

Open
jongund opened this issue Apr 23, 2015 · 1 comment
Open

live region recommendations #4

jongund opened this issue Apr 23, 2015 · 1 comment

Comments

@jongund
Copy link

jongund commented Apr 23, 2015

Live regions should only be used to announce changes in content that happen asynchornously to user action, like a message posted to a real time chat, or updates to a stock price that is automatically updated on a page.

Live regions should not be used on popup menus and other content that appears due to user action to open the menu.

In single page applications should manage focus to make sure the user stays oriented to the content and purpose of the page. Putting a live region on all the dynamically changing content will be confusing and disorienting to users of assistive technology.

@mendeza
Copy link

mendeza commented Aug 1, 2017

Hi @jongund,
What would you recommend for the typical form validation cases? Please see at bottom use of aria-live="assertive", and alternatively role="alert".

<!-- Initial valid state -->
<label for="startTime">
  Please enter a start time for the meeting:
</label>
<input id="startTime"
       type="text"
       aria-errormessage="msgID"
       aria-invalid="false"> <!-- false | "" | (not present) -->
<span id="msgID" aria-live="off"> <!-- initially not visible -->
  Invalid time: the time must be between 9:00 AM and 5:00 PM"
</span>

<!-- User has input an invalid value -->
<label for="startTime"> 
  Please enter a start time for the meeting:
</label>
<input id="startTime"
       type="text"
       aria-errormessage="msgID"
       aria-invalid="true">
<span id="msgID" aria-live="assertive"> <!-- shown when needed -->
  Invalid time: the time must be between 9:00 AM and 5:00 PM
</span>
<span id="msgID" role="alert"> <!-- alternative, supposedly equivalent -->
  Invalid time: the time must be between 9:00 AM and 5:00 PM
</span>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants