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 suggestions list and loading progressbar labels #204

Conversation

afercia
Copy link
Contributor

@afercia afercia commented Jan 18, 2024

Fixes #196

This PR aims to improve the accessible labels of two components of the user interface.
Also, the current label are hardcoded English text. In projects that are translated to other languages, these labels need to be passed via prop so that they are translatable.

1
The suggestions list.
Currently, it is labelled via both aria-label and aria-labelledby. This is redundant as aria-labelledby will always override aria-label. Also, aria-labelledby points to the search input id. As a result, the list of suggestions is labeled with the term users type in the search field, which is inappropriate.

  • Removes the aria-labelledby attribute.
  • Adds a prop to pass the aria-label value.

2
Loading progressbar label.
Currently, it's hardcoded English text.

  • Adds a prop to pass the aria-label value.

Copy link

vercel bot commented Jan 18, 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 Jan 18, 2024 2:14pm

@afercia
Copy link
Contributor Author

afercia commented Jan 18, 2024

For reference: the labeling issues were discovered while working on the cmdk implementation in the WordPress editor project, see WordPress/gutenberg#56718

@pacocoursey pacocoursey merged commit 1724300 into pacocoursey:main Jan 30, 2024
2 of 3 checks passed
@afercia
Copy link
Contributor Author

afercia commented Feb 5, 2024

Hello @pacocoursey and thanks for merging this.
Is there any plan to include it in a next release soon? I'm asking because of an open issue in the WordPress editor repository, where in absence of this fix we would need to resort to some hacky workaround. See WordPress/gutenberg#56718
Thanks in advance for your reply, much appreciated 🙇
Cc @youknowriad

@pacocoursey
Copy link
Owner

@afercia Released in cmdk@1.0.0

@afercia
Copy link
Contributor Author

afercia commented Mar 8, 2024

@pacocoursey thank you! ❤️

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.

Fix the Suggestions listbox labeling
2 participants