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

[Accessibility] Use id instead of children #254

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UltimateGG
Copy link

Closes #253

Values were not being read aloud when selected with mouse, arrow keys, etc.
This is because:

  1. The aria-activedescendant was not being updated
  2. The element with the aria-activedescendant must be focused to read the value it references aloud

Finding the selected item was previously done using a querySelector and encodeUri which is bad because if children are used instead of a string, this will not serialize well (As well as spaces, special characters, etc.). The new approach is more robust and uses the actual ID in the dom.

The focus issue is solved by changing the focus back to the command input, or outer list container when the value is updated.

Copy link

vercel bot commented May 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cmdk-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2024 5:27am

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

Successfully merging this pull request may close these issues.

Accessibility: Items not read aloud
1 participant