jquery / jquery/jquery-ui

ARIA attributes in autocomplete and tooltip

Open
#2,088 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Accessibility Behavior shared with 1.12 Comp: Autocomplete Comp: Tooltip
Dominant language
JavaScript
Stars
11.3k
Forks
5.2k
PR merge metrics
No merged PRs in 30d

Description

From the report on WordPress Trac #54681

Russell Eck:

An error container class="ui-helper-hidden-accessible" is made with aria-live="assertive", but it does not contain a WAI-ARIA attribute that will make sure all assistive technologies can read the error message after more than one invalid submission.

Adding the aria-atomic="true" to the error container tag will ensure assistive technologies can read the message after more than one invalid submission.

@afercia:

I'm not sure an aria-atomic attribute is the only change that should be made.

  • autocomplete.js: it uses a role="status". which has an implicit aria-atomic value of true. It also uses an aria-live="assertive" attribute which overrides the default polite value of the role="status". At this point, it would be better to make it a role="alert" and omit the other attributes.

Seems to me the current jQuery UI implementation shows a bit its age. Some years ago the alert and status roles weren't fully supported. At that time, it was pretty common to build aria-live regions by setting the (implicit) attributes explicitly. Today, support has improved and it would be better to use some more modern code.

https://github.com/jquery/jquery-ui/blob/e21a2543b55680f23aaa7efa38f3288b8e767e7d/ui/widgets/autocomplete.js#L308-L315
https://github.com/jquery/jquery-ui/blob/e21a2543b55680f23aaa7efa38f3288b8e767e7d/ui/widgets/tooltip.js#L108-L116

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the cited sections of ui/widgets/autocomplete.js and ui/widgets/tooltip.js, then inspect their existing widget tests. Confirm the intended ARIA semantics for the live regions and error announcements, and consider the work done when repeated submissions and autocomplete announcements are correctly exposed to assistive technologies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery
Domain
accessibility, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.