jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

ARIA attributes in autocomplete and tooltip

Open sabernhardt opened this issue 3 years ago • 1 comments

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

sabernhardt avatar Jun 16 '22 16:06 sabernhardt

Thanks for the report. Since the issue is already in 1.12, given limited team resources it's not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/. PRs are welcome if they're not too complex.

mgol avatar Jun 22 '22 10:06 mgol