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

fix result option highlighting for screenreaders #5413

Conversation

JoshMoreno
Copy link

@JoshMoreno JoshMoreno commented Nov 13, 2018

Addresses #3735 and pull request #3821

Not very familiar with the codebase and didn't have much time. Hope this helps move the accessibility improvements in the right direction.

From what I can deduce from various examplesaria-activedescendent should be updated to the id of the current highlighted result. Also, aria-activedescendent is on the input in the examples.

Examples:

@kevin-brown
Copy link
Member

Hi there,

Thanks for your contribution to Select2. This is something I'm definitely interested in seeing land in Select2 4, but unfortunately right now there appear to be some failing tests.

It looks like those tests are failing because this is attempting to set the attribute for the search box within the results dropdown. Because Select2 works in both a single select mode (where the search is in the dropdown) and multiselect mode (where the search is in with the selection), we cannot rely on the location of the search. Or even on it existing, since it's possible to disable the search box.

My suggestion to fix this issue would be to look into moving these calls into the Search.js files which power the single select and multiselect dropdowns, so we don't accidentally tie the results to the search itself. If you need to pass data between the results and the search box, you can trigger an internal event by calling .trigger() and this will propagate to the other areas of Select2.

Let me know if you have any questions or need any assistance.

@stale
Copy link

stale bot commented Mar 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 Mar 13, 2019
@ScriptShot
Copy link

Hi, is there any progress or news here? It would be great if this were implemented :)

@stale stale bot removed the status: stale label Mar 14, 2019
@stale
Copy link

stale bot commented May 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 May 13, 2019
@ScriptShot
Copy link

Knock knock...

@stale
Copy link

stale bot commented Jul 12, 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 12, 2019
@kevin-brown
Copy link
Member

Two notes for why this hasn't been accepted yet:

  1. It's trying to set properties on the search box from within the results. Select2 enforces a clear separation here, since we have multiple places where a search box can be, and as a result this would need to be modified so these event handlers are present within the search components and not the results component.

  2. This is missing unit tests. While we don't require them for all changes, we try to increase the coverage as we go and as a result I end up writing a lot of unit tests that other people chose not to write. Because of this, reviewing and accepting pull requests can go from a few minutes per pull request to over an hour, depending on how much work needs to go into fixing issues discovered through testing.

If someone is willing to submit an alternate pull request, or update this one, that fixes one or both of those issues, I'll gladly re-review it. If not, the Stale bot will show up in 60 days and close this one out.

@stale stale bot removed the status: stale label Jul 16, 2019
@kevin-brown
Copy link
Member

Closing this off in favor of #5582, where this is implemented (among other things).

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

3 participants