Skip to content
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

Conversation

afercia
Copy link

@afercia afercia commented May 10, 2016

This pull request includes a

  • Bug fix
  • New feature
  • Translation

The following changes were made

  • fixes ARIA roles for the selection element and the search field
  • fixes ARIA roles for the results list
  • fixes ARIA properties aria-owns, aria-activedescendant, and aria-autocomplete
  • fixes ARIA role for the aria-live message

If 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.

@@ -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"' +
Copy link
Member

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?

Copy link
Author

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

@kevin-brown
Copy link
Member

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.

@michalkleiner
Copy link
Contributor

Related PR #4881.

@stale

This comment has been minimized.

@stale stale bot added the status: stale label Mar 13, 2019
@michalkleiner

This comment has been minimized.

@stale stale bot removed the status: stale label Mar 13, 2019
@stale

This comment has been minimized.

@stale stale bot added the status: stale label May 12, 2019
@kevin-brown
Copy link
Member

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.

@stale
Copy link

stale bot commented Jul 13, 2019

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.

@stale stale bot added the status: stale label Jul 13, 2019
@michalkleiner
Copy link
Contributor

Bump again.

@kevin-brown
Copy link
Member

I've started to pull the changes here out into #5582 where I'm adding some tests and fixing the merge conflicts.

@kevin-brown
Copy link
Member

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 listbox when it does not have a searchbox, and like a combobox when it does have a search box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants