Open afercia opened 5 years ago
I don't think the publish button iis usinig the aria-live anymore.
Right, aria-live
was removed in https://github.com/WordPress/gutenberg/pull/15381
However, there's still the need for an audible message to confirm a new date has been set and a speak()
message should be used. See https://github.com/WordPress/gutenberg/issues/15292
Reopening and updating the title to better clarify which "publish" button this issue refers to.
Noticed while testing https://github.com/WordPress/gutenberg/pull/15381
The publish button has an
aria-live="polite"
attribute that was introduced to make the button text changes announced by screen readers.Aside: Worth noting this button, together with the Visibility button, has many accessibility issues and there's a long standing issue about them, see #470.
While the intent was good, the actual behavior is not ideal. Using only
aria-live="polite"
withoutaria-atomic
andaria-relevant
doesn't work as expected.By default, only changes within an aria-live region get announced. That means if the aria-live region initial content is, let's say:
Apr 20, 2019 12:54 pm
and then in the calendar I change the date to April 19, the new string will be:
Apr 19, 2019 12:54 pm
Actually, the only part that is changed is
19
and that's exactly what screen readers will announce. Screenshot testing with Firefox and NVDA:(Note: for the untranslated date values there's already #15348)
This is certainly not desirable. Instead of using aria-live on the button itself, a better option would be to use
speak()
with a meaningful message. Something like:Publish date set to Apr 19, 2019 12:54 pm
This would also decouple the announcement feature from future changes to the UI markup, make things more maintainable and consistent.