-
Notifications
You must be signed in to change notification settings - Fork 776
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(aria-required-children): allow comboboxes with more popup roles #1950
Conversation
00b4059
to
8ec657c
Compare
8ec657c
to
8a9c7b6
Compare
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.
Very minor comment. Looks excellent. I like this better then how I would have done it!
for (let index = 0; index < expandedChildRoles.length; index++) { | ||
const expandedChildRole = expandedChildRoles[index]; | ||
// keep the specified popup type required if expanded | ||
if (expanded && expandedChildRole === popupRole) { |
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 probably make this case insensitive.
const popupRole = node.getAttribute('aria-haspopup') || 'listbox'; | ||
const popupRole = ( | ||
node.getAttribute('aria-haspopup') || 'listbox' | ||
).toLowerCase(); |
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.
Please test this too.
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.
@AdnoC looks like this comment was not addressed - https://github.com/dequelabs/axe-core/pull/1950/files#r360322055
The popup attribute text is made lowercase, causing the comparison to be case insensitive: https://github.com/dequelabs/axe-core/pull/1950/files#diff-5b800295554e9fa19a69589b10125fcfR83
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.
Actually, no. Case sensitivity test still need to be added.
Adds the other allowed expanded child types to the
combobox
owned requirements. If the box is open it checks what the expected role of the expanded element should be and only makes that required. If the box is closed it doesn't make any of them required.Also modernized the rest of the file (
var
->let
orconst
)Closes issue: #1009
Reviewer checks
Required fields, to be filled out by PR reviewer(s)