-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Announce notices to assertive technologies #4192
Conversation
I think a generic way would be preferable as by default we would always announce notices.
One option the overcome that problem in a generic approach would be to add an option called spokenMessage to createNotice options. When that option is present we would use that property instead of the normal notice message for the spoken text. |
I thought about this, but if the developer is unaware of the behavior, this might produce "wrong" messages (html inside etc...). Thoughts @afercia |
Hm as far as I know, |
dd30136
to
c668bb3
Compare
PR updated with the generic approach. |
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.
From the code point view changes look good to me 👍
@@ -346,6 +346,7 @@ describe( 'effects', () => { | |||
id: 'SAVE_POST_NOTICE_ID', | |||
isDismissible: true, | |||
status: 'success', | |||
spokenMessage: 'Post published!', |
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 should be localized.
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.
Actually, these are only tests. The message is localized :)
closes #3690
This PR uses the a11y lib to announce the publish flow notices to assertive technologies.
I was wondering if I should do this systematically for all notices (in a generic way) but decided not to because the assertive message could defer from the notice's content.