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

aria-allowed-role with custom autocomplete (combobox + listbox, aria 1.0 vs aria 1.1) (PR #1118) #1116

Closed
georgiee opened this issue Aug 30, 2018 · 5 comments
Assignees
Labels
fix Bug fixes rules Issue or false result from an axe-core rule

Comments

@georgiee
Copy link

An error newly introduced during our housekeeping. axe-core was upgraded from 3.0.3 to 3.1.1.

The following markup got identified as invalid (shorten)

"<input aria-autocomplete="list" aria-label="some label" autocomplete="off"  role="combobox" type="text" aria-expanded="true" aria-owns="autocomplete-0">"

<!-- somewhere else-->
<div id='autocomplete-0'>[...]</div>

Report from CLI looks like this (shorten):

id:"aria-allowed-role",
impact: "minor",
helpUrl: "https://dequeuniversity.com/rules/axe/3.1/aria-allowed-role?application=axeAPI",
nodes: [{
  failureSummary: "Fix any of the following: role combobox  is not allowed for given element",
  html: '...',
  impact: "minor"
}]

The linked help resource by axe cli is the following:
https://dequeuniversity.com/rules/axe/3.1/aria-allowed-role?application=axeAPI

More helping is this URL:
https://www.w3.org/TR/wai-aria-1.1/#combobox

So the problem is the role combobox directly on the input. With aria 1.1 it must be on the parent while the text should get the role textbox or searchbox.

The linked w3.org document also says the following.

The ARIA 1.0 specification describes a combobox pattern where a text input element has the combobox role and owns a listbox element. User agents, assistive technologies, and conformance checkers SHOULD continue to support the ARIA 1.0 pattern so that existing implementations of the ARIA 1.0 pattern remain functional.

Should Axe continue reporting it as minor, allow me to change the aria version with the configuration (couldn't find this option yet) or is it expected just to disable it like shown in the following workaround?

Workaround:

axe.configure({
      rules: [
        {
          id: 'aria-allowed-role',
          enabled: false
        }
      ]
});

Thanks for reading.

@WilcoFiers
Copy link
Contributor

Thanks for reporting. This does seem to be incorrect. Combobox is an allowed role on input[type=text]. @JKODU can you go through this again and verify what we missed for this?

@WilcoFiers WilcoFiers added the fix Bug fixes label Aug 30, 2018
@georgiee
Copy link
Author

From https://www.w3.org/TR/wai-aria-1.1/#combobox

combobox (role)
Authors MUST ensure an element with role combobox contains or owns a text input element with role textbox or searchbox and that the text input has aria-multiline set to false.

I understand it like combobox should be assigned to the parent (following aria 1.1). On the other hand aria 1.0 with its legacy custombox allowed it on the input itself.

See here:
https://www.w3.org/TR/2018/WD-wai-aria-practices-1.2-20180719/examples/combobox/aria1.0pattern/combobox-autocomplete-none.html#rps_label_textbox

Column 'usage' says:

Note: The primary difference between the ARIA 1.0 pattern and the ARIA 1.1 pattern is the placement of the combobox role.

@jeeyyy
Copy link
Contributor

jeeyyy commented Aug 31, 2018

@georgiee - Thanks for the additional information.

@WilcoFiers - I have narrowed down the issue. The specs around the 'combobox' role are quite different between ARIA1.0 and 1.1. I'm looking at the best way to fit in backwards compatibility here.

Will link you both in the PR.

@jeeyyy
Copy link
Contributor

jeeyyy commented Sep 3, 2018

PR - #1118

@jeeyyy jeeyyy changed the title aria-allowed-role with custom autocomplete (combobox + listbox, aria 1.0 vs aria 1.1) aria-allowed-role with custom autocomplete (combobox + listbox, aria 1.0 vs aria 1.1) (PR - 1118) Sep 3, 2018
@jeeyyy jeeyyy changed the title aria-allowed-role with custom autocomplete (combobox + listbox, aria 1.0 vs aria 1.1) (PR - 1118) aria-allowed-role with custom autocomplete (combobox + listbox, aria 1.0 vs aria 1.1) (PR #1118) Sep 3, 2018
@jeeyyy
Copy link
Contributor

jeeyyy commented Sep 26, 2018

PR has been merged. Closing issue.

@jeeyyy jeeyyy closed this as completed Sep 26, 2018
@WilcoFiers WilcoFiers added the rules Issue or false result from an axe-core rule label Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes rules Issue or false result from an axe-core rule
Projects
None yet
Development

No branches or pull requests

3 participants