Improve the labeling of EntitiesSavedStates#67473
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks for working on this, @dhruvang21! It seems that there's alternative PR with ongoing reviews. Do you mind leaving a comment there so we can give you props when it's merged? Meanwhile, I would suggest we close this PR. cc @afercia |
|
sure @Mamaduka i will comment on that PR and you can close this PR. |
|
Closing in favor of #67792 |
Fixes #67354
What?
This PR updates the behavior of the EntitiesSavedStates component when used in a modal dialog (role="dialog") to ensure the dialog labeling is appropriate. Specifically:
The aria-labelledby attribute now references only the primary label text (Are you ready to save?).
The additionalPrompt text is moved to the aria-describedby attribute, ensuring it acts as a supplementary description instead of being included in the dialog label.
Why?
When additionalPrompt is passed, it becomes part of the dialog label, which can make the labeling overly long and misleading. For example, in the Theme preview of the Site Editor, the dialog label currently reads:
"Are you ready to save? Saving your changes will change your active theme from Twenty Twenty-Five to Twenty Twenty-Four."
This excessively long label makes it harder for users, especially those using assistive technologies, to quickly understand the purpose of the dialog. By separating the primary label and the additional descriptive text, we enhance usability and accessibility.
How?
Updated Markup for Descriptions:
Testing Instructions
The aria-labelledby attribute references only the primary label.
The aria-describedby attribute includes the additionalPrompt text.
Screenshots or screencast