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
Stories/af/fix main aria roles properties #4348
Conversation
@@ -9,9 +9,9 @@ define([ | |||
|
|||
var $search = $( | |||
'<span class="select2-search select2-search--dropdown">' + | |||
'<input class="select2-search__field" type="search" tabindex="-1"' + | |||
'<input class="select2-search__field" type="text" tabindex="-1"' + |
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
I want to thank Paal Joachim Romdahl for reminding me about this pull request, not because I forgot about it (I've been discussing this with a few others for a while now), but because I never publicly commented about the plans for Select2 to handle this. As has been mentioned a couple of times before, Select2 supports a wide variety of use cases, some of which are natively supported by screen readers and others not so much. Our goal with Select2 4.0.0 was to make Select2 natively accessible and to do it right the first time, so we didn't have to hack it in later. Part of that involved researching existing implementations, looking into any recent improvements to ARIA, and doing some testing of our own along the way. As we've clearly learned after the release of Select2 4.0.0, we didn't get it right the first time, we actually got it very wrong. We accept that, and hopefully we can get Select2 to a state where it is at least partially acceptable, so the most basic use cases work natively. From there, we hope to work to get the more advanced use cases supported. In the next couple of weeks, we plan to work with others to get Select2 to be accessible under the most basic use case: a flat dropdown that is searchable. Since that appears to be the use case that most screen readers support. |
Related PR #4881. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Alright, time to kick this again since it got stale. We dropped the ball on this PR. We've continued to drop the ball throughout the years. This PR is still valid and fixes a valid problem. Even though it has a merge conflict now, it's one of the ones we're willing to correct the merge conflict on and manually apply the changes back once they're reviewed. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Bump again. |
I've started to pull the changes here out into #5582 where I'm adding some tests and fixing the merge conflicts. |
Closing this off in favor of #5582. The only thing implemented here that is not implemented in that PR is the handling of dropdowns without search boxes. I am going to spin off a new ticket about it, but my initial thinking is that Select2 should behave like a |
This pull request includes a
The following changes were made
aria-owns
,aria-activedescendant
, andaria-autocomplete
aria-live
messageIf this is related to an existing ticket, include a link to it as well.
See #3735
As mentioned in #3735 making the dropdown options being announced by screen reader will require several steps. Will comment with more details on the issue.