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

fix(combobox): support aria 1.2 pattern for comboboxes #3033

Merged
merged 9 commits into from
Jul 6, 2021

Conversation

clottman
Copy link
Contributor

@clottman clottman commented Jun 23, 2021

Closes issue: #2505

@@ -117,8 +117,8 @@ const ariaRoles = {
},
combobox: {
type: 'composite',
requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'],
requiredAttrs: ['aria-expanded'],
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From #2505 (comment)

It seems like if axe removed the aria-required-children for combobox entirely

Suggested change
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'],

requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'],
requiredAttrs: ['aria-expanded'],
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'],
requiredAttrs: ['aria-expanded', 'aria-controls', 'aria-owns'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implies that both are required when in reality it's just one or the other. That's not something we can support, so maybe we just list the 1.2 spec required attrs and then special case aria-owns to support the 1.0/1 pattern in aria-required-attrs-evaluate.

Also add aria-owns to the allowedAttrs array and remove aria-controls from it (since it's now in the required array).

Suggested change
requiredAttrs: ['aria-expanded', 'aria-controls', 'aria-owns'],
requiredAttrs: ['aria-expanded', 'aria-controls'],

lib/checks/aria/aria-required-children-evaluate.js Outdated Show resolved Hide resolved
lib/checks/aria/aria-required-attr-evaluate.js Outdated Show resolved Hide resolved
@clottman clottman marked this pull request as ready for review June 24, 2021 19:18
@clottman clottman requested a review from a team as a code owner June 24, 2021 19:18
@@ -28,7 +28,14 @@
ok
</div>
<div role="heading" id="pass4" aria-level="1">ok</div>
<div role="combobox" id="pass5" aria-expanded="true">ok</div>
<div
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add another comobox that uses the aria-owned pattern as well

@clottman clottman requested a review from straker June 29, 2021 17:49
@clottman clottman changed the title feat(combobox): support aria 1.2 pattern for comboboxes fix(combobox): support aria 1.2 pattern for comboboxes Jul 6, 2021
@straker straker merged commit 5ab026d into develop Jul 6, 2021
@straker straker deleted the 2505-combobox-1.2 branch July 6, 2021 15:20
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

Successfully merging this pull request may close these issues.

2 participants