w3c / aria

Accessible Rich Internet Applications (WAI-ARIA)
https://w3c.github.io/aria/
Other
635 stars 120 forks source link

Clarify expected AT behavior when the accessible name of a focused control is updated. #2178

Open khiga8 opened 2 months ago

khiga8 commented 2 months ago

Describe your concern

Hi! I noticed inconsistent screen reader announcement behavior when the content of a button that is currently receiving focus changes. I wanted to surface this concern somewhere to get clarity. Please let me know if I should file this issue elsewhere.

We have some buttons where the content of a button (visible label/accessible name) changes to communicate a change in state.

For example:

PlayPause SubscribeUnsubscribe

I tested a few different implementations so we can ensure that these changes are communicated to AT users, but noticed inconsistent behavior across different screen reader/browser combos. It is unclear what the expected behavior is. Should the AT announce this change by default if user focus is already on it, or is the expectation to rely on live region techniques?

Test scenarios

Codepen

(Note: I copied my test scenarios into the above CodePen. It is worth noting that there is a bug in VoiceOver that results in double live region announcements within an <iframe>, so you may hear an extra announcement)

Scenario 1: Button where the content is updated (base case)

Should this scenario result in an announcement?

Scenario 2: Updating aria-label in addition to the button content

Strangely enough, when the aria-label is updated, announcements seem to trigger, once, consistently.

However, setting aria-label for the purpose of triggering an announcement isn't really idea.

Other scenarios

I've tested several other scenarios including:

Link to the version of the specification or documentation you were looking at at.

Link to documentation:

scottaohara commented 2 months ago

related to / semi-duplicate of https://github.com/w3c/core-aam/issues/224