-
Notifications
You must be signed in to change notification settings - Fork 788
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(required-children): add combobox > listbox exception #559
Conversation
No longer requires a collapsed combobox to own a child listbox #548
Done. |
Allows role=textbox child to be missing from <input type=search role=combobox> parent Closes #549
lib/checks/aria/required-children.js
Outdated
@@ -51,7 +51,7 @@ function missingRequiredChildren(node, childRoles, all, role) { | |||
|
|||
// remove 'textbox' from missing roles if combobox is a native input | |||
var textboxIndex = missing.indexOf('textbox'); | |||
if (textboxIndex >= 0 && node.tagName === 'INPUT' && node.type === 'text') { | |||
if (textboxIndex >= 0 && node.tagName === 'INPUT' && ['text', 'search'].indexOf(node.type) >= 0) { |
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.
I think there are probably other types that make sense 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.
Good point. Which other types are you thinking of? To me, the only other types that seem reasonable to use as the basis of a combobox are "email" and "url". Beyond that, "tel" might be worth supporting.
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.
I added "email", "url", and "tel" to the excepted input types.
… > textbox Allows role=textbox to be missing from <input type=email|url|tel role=combobox> Related to #549
No longer requires a collapsed combobox to own a child listbox.
The relevant ARIA 1.1 spec: https://www.w3.org/TR/wai-aria-1.1/#combobox
#548