-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix a11y of descriptions and alerts for "Invalid" Nav Items #73177
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
Conversation
Changed 'update' to 'edit', as using the same word in both the button and the error helps connect the concept better.
The role="alert" and aria-live="polite" attributes were causing the error message to be announced twice to screen readers. Since this text is referenced via aria-describedby on the input field, it will be read when users focus the field - no live announcement is needed.
|
Size Change: +38 B (0%) Total Size: 2.41 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 0afa4a2. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/19279649780
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works well. I tested with Taxonomies as well as Posts.
I did notice that Taxonomy links don't have the Invalid suffix.
Unfortunately all the changes that are within the Nav Link edit file also need to be made in the Submenu file for this to work as expected. As a result I'm concerned about scope - if some of this already happens in 6.8 then we shouldn't be fixing during RC for 6.9.
Just noting that if targeting WP 6.9 RC we need to aim to land an absolute minimal change set. What do you think is the smallest set of changes we could land here?
Co-authored-by: Dave Smith <getdavemail@gmail.com>
| role="alert" | ||
| aria-live="polite" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were the important ones to remove here, as they announce the message twice on mount. We don't need them announced on mount, just to be available.
I don't think that's true? I don't see a similar file for Submenus that would require an update to the help text.
This PR is the minimal changeset to fix accessibility issues introduced by #73142, so it should be allowed for the 6.9 RC. |
|
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. |
| /* translators: %s is the entity type (e.g., "page", "post", "category") */ | ||
| __( 'Synced %s is missing. Please update or remove this link.' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that this is not a string change. It is the same as the original 👍
getdave
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an important bug fix that enables users of assistive technology to perceive important error states.
As a result, I think it should be included in WP 6.9 RC.
The changeset is minimal and targeted.
cc @ellatrix for triage.
The role="alert" and aria-live="polite" attributes were causing the error message to be announced twice to screen readers. Since this text is referenced via aria-describedby on the input field, it will be read when users focus the field - no live announcement is needed. This also adds aria-invalid and aria-describedBy to the navigation link block if the synced entity is not found. This allows screen reader users to be aware of the issue on canvas as well. --------- Co-authored-by: Dave Smith <getdavemail@gmail.com>
|
I just cherry-picked this PR to the wp/6.9 branch to get it included in the next release: bcc4ea3 |
|
I think I wasn't supposed to add the label for the backport 😬 I forgot it would automatically backport it. I meant to just flag it to be backported. |
Changes can be found at https://github.com/WordPress/gutenberg/commits/wp/6.9/. - [Block Bindings: Add unit test coverage for `core/post-data` source](WordPress/gutenberg#73055) - [Block Bindings: Error handling for external sources.](WordPress/gutenberg#72585) - [Notes: Collapse note on blur](WordPress/gutenberg#73158) - [Border-radius values triggers unintended px conversion](WordPress/gutenberg#73324) - [Fix navigation tag entity binding](WordPress/gutenberg#73255) - [DataViews: ensure primary actions are not wrapped in the list layout](WordPress/gutenberg#73345) - [Fix: Fit Text may overflow into the padding area.](WordPress/gutenberg#73327) - [Merge "Icon Size" and "Icon size" translation strings](WordPress/gutenberg#73325) - [Notes: Improve delete confirm message for replies](WordPress/gutenberg#73173) - [Fix: Custom font size taking over fit text.](WordPress/gutenberg#73241) - [Fix a11y of descriptions and alerts for "Invalid" Nav Items](WordPress/gutenberg#73177) - [Stretchy text: Hide variations in Block Inspector (hack)](WordPress/gutenberg#73238) - [Update button label from "Add new note" to "Add new reply"](WordPress/gutenberg#73189) - [Notes: Fix first note creation with pinned sidebar](WordPress/gutenberg#73164) Developed in #10528. See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches. Fixes #64267. Props priethor. git-svn-id: https://develop.svn.wordpress.org/trunk@61262 602fd350-edb4-49c9-b593-d223f7449a82
Changes can be found at https://github.com/WordPress/gutenberg/commits/wp/6.9/. - [Block Bindings: Add unit test coverage for `core/post-data` source](WordPress/gutenberg#73055) - [Block Bindings: Error handling for external sources.](WordPress/gutenberg#72585) - [Notes: Collapse note on blur](WordPress/gutenberg#73158) - [Border-radius values triggers unintended px conversion](WordPress/gutenberg#73324) - [Fix navigation tag entity binding](WordPress/gutenberg#73255) - [DataViews: ensure primary actions are not wrapped in the list layout](WordPress/gutenberg#73345) - [Fix: Fit Text may overflow into the padding area.](WordPress/gutenberg#73327) - [Merge "Icon Size" and "Icon size" translation strings](WordPress/gutenberg#73325) - [Notes: Improve delete confirm message for replies](WordPress/gutenberg#73173) - [Fix: Custom font size taking over fit text.](WordPress/gutenberg#73241) - [Fix a11y of descriptions and alerts for "Invalid" Nav Items](WordPress/gutenberg#73177) - [Stretchy text: Hide variations in Block Inspector (hack)](WordPress/gutenberg#73238) - [Update button label from "Add new note" to "Add new reply"](WordPress/gutenberg#73189) - [Notes: Fix first note creation with pinned sidebar](WordPress/gutenberg#73164) Developed in WordPress/wordpress-develop#10528. See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches. Fixes #64267. Props priethor. Built from https://develop.svn.wordpress.org/trunk@61262 git-svn-id: http://core.svn.wordpress.org/trunk@60574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changes can be found at https://github.com/WordPress/gutenberg/commits/wp/6.9/. - [Block Bindings: Add unit test coverage for `core/post-data` source](WordPress/gutenberg#73055) - [Block Bindings: Error handling for external sources.](WordPress/gutenberg#72585) - [Notes: Collapse note on blur](WordPress/gutenberg#73158) - [Border-radius values triggers unintended px conversion](WordPress/gutenberg#73324) - [Fix navigation tag entity binding](WordPress/gutenberg#73255) - [DataViews: ensure primary actions are not wrapped in the list layout](WordPress/gutenberg#73345) - [Fix: Fit Text may overflow into the padding area.](WordPress/gutenberg#73327) - [Merge "Icon Size" and "Icon size" translation strings](WordPress/gutenberg#73325) - [Notes: Improve delete confirm message for replies](WordPress/gutenberg#73173) - [Fix: Custom font size taking over fit text.](WordPress/gutenberg#73241) - [Fix a11y of descriptions and alerts for "Invalid" Nav Items](WordPress/gutenberg#73177) - [Stretchy text: Hide variations in Block Inspector (hack)](WordPress/gutenberg#73238) - [Update button label from "Add new note" to "Add new reply"](WordPress/gutenberg#73189) - [Notes: Fix first note creation with pinned sidebar](WordPress/gutenberg#73164) Developed in WordPress/wordpress-develop#10528. See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches. Fixes #64267. Props priethor. Built from https://develop.svn.wordpress.org/trunk@61262 git-svn-id: https://core.svn.wordpress.org/trunk@60574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Changes can be found at https://github.com/WordPress/gutenberg/commits/wp/6.9/. [Block Bindings: Add unit test coverage for core/post-data source](WordPress/gutenberg#73055) [Block Bindings: Error handling for external sources.](WordPress/gutenberg#72585) [Notes: Collapse note on blur](WordPress/gutenberg#73158) [Border-radius values triggers unintended px conversion](WordPress/gutenberg#73324) [Fix navigation tag entity binding](WordPress/gutenberg#73255) [DataViews: ensure primary actions are not wrapped in the list layout](WordPress/gutenberg#73345) [Fix: Fit Text may overflow into the padding area.](WordPress/gutenberg#73327) [Merge "Icon Size" and "Icon size" translation strings](WordPress/gutenberg#73325) [Notes: Improve delete confirm message for replies](WordPress/gutenberg#73173) [Fix: Custom font size taking over fit text.](WordPress/gutenberg#73241) [Fix a11y of descriptions and alerts for "Invalid" Nav Items](WordPress/gutenberg#73177) [Stretchy text: Hide variations in Block Inspector (hack)](WordPress/gutenberg#73238) [Update button label from "Add new note" to "Add new reply"](WordPress/gutenberg#73189) [Notes: Fix first note creation with pinned sidebar](WordPress/gutenberg#73164) Developed in #10528. See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches. Reviewed by davidbaumwald. Merges [61262] to the 6.9 branch. Props priethor, ellatrix. See #64267. git-svn-id: https://develop.svn.wordpress.org/branches/6.9@61263 602fd350-edb4-49c9-b593-d223f7449a82
Changes can be found at https://github.com/WordPress/gutenberg/commits/wp/6.9/. [Block Bindings: Add unit test coverage for core/post-data source](WordPress/gutenberg#73055) [Block Bindings: Error handling for external sources.](WordPress/gutenberg#72585) [Notes: Collapse note on blur](WordPress/gutenberg#73158) [Border-radius values triggers unintended px conversion](WordPress/gutenberg#73324) [Fix navigation tag entity binding](WordPress/gutenberg#73255) [DataViews: ensure primary actions are not wrapped in the list layout](WordPress/gutenberg#73345) [Fix: Fit Text may overflow into the padding area.](WordPress/gutenberg#73327) [Merge "Icon Size" and "Icon size" translation strings](WordPress/gutenberg#73325) [Notes: Improve delete confirm message for replies](WordPress/gutenberg#73173) [Fix: Custom font size taking over fit text.](WordPress/gutenberg#73241) [Fix a11y of descriptions and alerts for "Invalid" Nav Items](WordPress/gutenberg#73177) [Stretchy text: Hide variations in Block Inspector (hack)](WordPress/gutenberg#73238) [Update button label from "Add new note" to "Add new reply"](WordPress/gutenberg#73189) [Notes: Fix first note creation with pinned sidebar](WordPress/gutenberg#73164) Developed in WordPress/wordpress-develop#10528. See https://make.wordpress.org/core/handbook/about/release-cycle/block-editor-release-process-for-major-releases/#package-updates-and-core-patches. Reviewed by davidbaumwald. Merges [61262] to the 6.9 branch. Props priethor, ellatrix. See #64267. Built from https://develop.svn.wordpress.org/branches/6.9@61263 git-svn-id: http://core.svn.wordpress.org/branches/6.9@60575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Closes
Follow up to #73142 to fix accessible descriptions and alerts.
Why?
The original PR was a fix for 6.9, and this PR follows up to ensure the fix is accessible to by making the error states perceivable to non-sighted users.
How?
aria-invalidstate to block level information so it's clear to screen reader users that the block needs attention.aria-describedbywith the same error message that appears in the inspector. This allows the error message for the invalid state to be close-by and perceivable to screen readers.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast