-
Notifications
You must be signed in to change notification settings - Fork 792
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
Conversation
lib/standards/aria-roles.js
Outdated
@@ -117,8 +117,8 @@ const ariaRoles = { | |||
}, | |||
combobox: { | |||
type: 'composite', | |||
requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], | |||
requiredAttrs: ['aria-expanded'], | |||
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'], |
There was a problem hiding this comment.
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
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'], |
lib/standards/aria-roles.js
Outdated
requiredOwned: ['listbox', 'tree', 'grid', 'dialog', 'textbox'], | ||
requiredAttrs: ['aria-expanded'], | ||
requiredOwned: ['listbox', 'tree', 'grid', 'dialog'], | ||
requiredAttrs: ['aria-expanded', 'aria-controls', 'aria-owns'], |
There was a problem hiding this comment.
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).
requiredAttrs: ['aria-expanded', 'aria-controls', 'aria-owns'], | |
requiredAttrs: ['aria-expanded', 'aria-controls'], |
@@ -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 |
There was a problem hiding this comment.
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
Closes issue: #2505