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

enhanceSelectElement does not correctly link to existing hint or error message #589

Open
edwardhorsford opened this issue Apr 20, 2023 · 1 comment

Comments

@edwardhorsford
Copy link
Contributor

When using the enhanceSelectElement, an autocomplete may have a hint or error message, but unfortunately these are not linked with aria-describedBy from the input - so assistive technologies cannot get them.

The fix for this would be for the autocomplete code to grab the existing ids from aria-describedby from the select it's enhancing, and include those in addition to the instructions span it adds.

In the mean time, a fix is that the instructions added by the autocomplete are configurable by teams. We can make sure the instructions include any existing hint / error message.

When initialising an a given select as an autocomplete:

  • Get the ids mentioned in the select aria-describedby - there can be more than one when the field is in error.
  • Get the text content of those elements.
  • Concat the text content together.
  • Append with any instructions for AT for how to use the autocomplete
  • provide this as tAssistiveHint when initialising the autocomplete.
@edwardhorsford
Copy link
Contributor Author

An alternate solution would be to use js to look up the original contents of aria-describedBy in the original select, then prepend these to the generated input.

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

No branches or pull requests

1 participant