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
Stories/af/fix main aria roles properties #4348
Changes from all commits
a5ab08b
a1a96df
c53c1ab
4ee1ebf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ define([ | |
|
||
Results.prototype.render = function () { | ||
var $results = $( | ||
'<ul class="select2-results__options" role="tree"></ul>' | ||
'<ul class="select2-results__options" role="listbox"></ul>' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How well does this work with a nested Part of the reason why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A "tree" widget is something different, from the spec:
On the other hand, the Combobox widget explicitly requires a listbox with options, see: I'm afraid ARIA doesn't provide a way to emulate the semantics of Testing the PR, only Firefox+NVDA announce the group "labels", IE11+JAWS skip the labels but do announce the options, Safari+VoiceOver announce just the "flat" ones. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also note that plain old HTML optgroups don't get conveyed to screen readers either, so there's no great loss there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For reference, in ARIA 1.2 |
||
); | ||
|
||
if (this.options.get('multiple')) { | ||
|
@@ -37,7 +37,7 @@ define([ | |
this.hideLoading(); | ||
|
||
var $message = $( | ||
'<li role="treeitem" aria-live="assertive"' + | ||
'<li role="alert" aria-live="assertive"' + | ||
' class="select2-results__option"></li>' | ||
); | ||
|
||
|
@@ -163,7 +163,7 @@ define([ | |
option.className = 'select2-results__option'; | ||
|
||
var attrs = { | ||
'role': 'treeitem', | ||
'role': 'option', | ||
'aria-selected': 'false' | ||
}; | ||
|
||
|
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.
The rest of the changes make sense, but I can't figure out why this change was needed. Can a search field not function as a combobox?
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.
Well, the semantics of this input field is completely overridden by the applied ARIA role. Technologies that understand ARIA will get it is a "combobox" (also, currently has a role="textbox") so the type attribute is not so much relevant.
About browsers, the only difference with a text box I'm aware of is webkit special styling which Select2 resets with CSS