Open talldan opened 3 months ago
Without testing, I would say that your instinct is right: spoken messages should only occur on interaction. I find it hard to see a good reason to announce these instructions at any time other than when a user is interacting with it.
I think this would benefit from some close reading of https://github.com/WordPress/gutenberg/pull/45801; there's a lot of discussion of the implementation this required. But I agree this might require some new addressing - perhaps the original proposal by @afercia would now work with Windows screen readers? Worth testing, anyway. But if these messages are overriding other important announcements, that's a problem.
@alexstine Also pinging you in case you want to take a new look at this.
@talldan The main problem is, these Placeholder
messages are only read on block render via useEffect
. If we could create some type of dynamic block watcher to announce state changes, I think that's probably the most full proof solution. Block render is not the same thing as block select or any type of state change that happens within the block. Surely there is a way to create a generic hook to listen for these.
Description
The
Placeholder
component'sinstructions
prop triggers whenever the component mounts and theinstructions
are defined, and this can be a little bit too much, causing it to take precedence over other messages or be announced very unexpectedly: https://github.com/WordPress/gutenberg/blob/27fbbd8e9b57495339a077ef0c8ba67a18392699/packages/components/src/placeholder/index.tsx#L82-L86For example, the message can be triggered when:
speak
is called the current spoken messages are cleared)If you have multiple blocks in a post in placeholder state they can also all try
speak
ing at once, which is very impolite.Feels to me like this prop doesn't work in the right way. The instructions should probably only be read when the block is interacted with (selected?) and even then some care needs to be taken to ensure it only happens infrequently preferably on the first interaction. I'd question whether a spoken message is the right option at all as I think they're best for providing feedback about a current user action, but it'd be good to get further accessibility feedback on that.
Step-by-step reproduction instructions
Note that the spoken message for switching back to Visual Editor mode is never announced and the
assertive
aria-live region is empty. The group block'sinstructions can be announced even though they're
polite` and not currently being interacted with.Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.