question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Permit ARIA 1.2 combobox (without textbox child)

See original GitHub issue

Expectation: A compliant ARIA 1.2 (draft) combobox should not raise axe violations.

Actual: ARIA 1.2 combobox raises aria-required-children violation. Demo: https://w3c.github.io/aria-practices/examples/combobox/combobox-select-only.html. Currently raises 1 violation, aria-required-children.

Motivation: ARIA 1.2 is redefining combobox (draft spec) to no longer require a textbox child because of various issues with the 1.1 combobox. Aside from resolving long-standing labelling and SR support issues, this is particularly useful for web applications that want to emulate a native select or provide a rich selection widget (e.g. a form select with a popup that includes multiselection, options filter, select all/none). The current common practice is to use a popup button as the trigger rather than a combobox, but this is problematic in a form setting because button has problems with aria-required (prohibited by spec, flagged by axe, though supported in practice) and aria-invalid (permitted by spec, but not supported in practice). I’ve tested the new pattern with combobox trigger on JAWS, NVDA, ChromeVox on ChromeOS, VoiceOver, iOS VoiceOver, and Android TalkBack, and they all correctly announce current value, requiredness, and invalidness. In light of the apparent widespread support and that it’s in a draft spec, it would be nice to permit it in axe. A couple of projects I’m involved with including Angular Material have already cut over to the new pattern because of the clear a11y wins, and we’re currently suppressing (in tooling) and manually ignoring (when using axe extension) the axe violation.


axe-core version: 3.5.5
axe-webdriver, extension or other integration version: 4.5.3

Browser and Assistive Technology versions

For Tooling issues:
- Platform:  Tested on Chrome 84 OS X, reproducible running axe-core as a standalone library on node v10.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:14
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
smhigleycommented, Mar 2, 2021

@straker / @WilcoFiers I did some testing, and I think axe wouldn’t require any special casing or version detection to make this work well. I created a few combobox variations of the 1.1 and 1.2 patterns that mix and match having a child input and switching aria-controls for aria-owns: https://codepen.io/smhigley/full/zYoEMWP. (I left off 1.0, because if you switch aria-owns for aria-controls, it just becomes 1.2).

As you can see, there is no practical support problem with removing the child input for the 1.1 pattern, or leaving out aria-owns in favor of aria-controls in the 1.1 pattern. So, for all patterns, the following are true:

  • No pattern requires a child input
  • All patterns require one of aria-owns or aria-controls, but it doesn’t matter which one

It seems like if axe removed the aria-required-children for combobox entirely, and added a check for either aria-owns or aria-controls regardless of pattern version, that should cover all cases.

This makes sense from a technical perspective: the thing doing the heavy lifting is aria-activedescendant, and it doesn’t really matter if the combo/listbox association is done via aria-owns or aria-controls. And a 1.1 pattern without a child input is just a select-only 1.2 pattern with aria-owns 😃

2reactions
AutoSpongecommented, Feb 11, 2021

For another example, here’s a demo using angular material that gets flagged in axe: https://angular-ph3vth-e514sq.stackblitz.io/. In this example, the listbox is dynamically created (axe complains it doesn’t have the right child) then continues to flag in the open state. I assume it’s because the listbox isn’t the first child (nested in a div). The listbox is directly linked with aria-controls.

If this example is accessible, then the rule aria-required-children is a false positive.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accessible Rich Internet Applications (WAI-ARIA) 1.2 - W3C
Type of DOM node that represents the textual content of an attribute or an element. A Text node has no child nodes. Tooltip...
Read more >
Does a combobox require a child element with the role of ...
Short Answer to "Does a combobox require a child element with the role of textbox?" Under current (aria-1.1) standards: yes. Longer Answer.
Read more >
Combobox - Lightning Design System
The listbox of options must be an owned child of the combobox . If it cannot be a direct child of the combobox...
Read more >
Does A Combobox Require A Child Element With ... - ADocLib
The combobox role seems to allow the keyboard commands coded in JS to work Without special coding, escape gets you out of the...
Read more >
WAI-ARIA Authoring Practices 1.2
Using a role without fulfilling the promise of that role is similar ... An editable combobox may either allow users to input any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found