Repository navigation
feat: support aria-busy state announcement - #240
AdamMagued wants to merge 2 commits into
Conversation
- Expose busy state and attribute mapping on accessibility nodes - Announce busy and not busy state transitions for focused elements - Support aria-busy on live regions, suppressing interim updates until busy period completes - Closes guidepup#36
|
Thanks for the contribution, and apologies for the slow review! Looks very thorough (nice work!) but I'm wondering if the implementation correctly captures the intent of As stands it's acting as both a state (which I think is great, nice one) but also a live region like announcement, whereas my understanding of the spec is not that we should expect "busy" or "not busy" to be announced, but rather the Pertinent parts from the spec:
REF: https://w3c.github.io/aria/#aria-busy For this implementation, inclined to not implement anything special/specific for the In terms of what actual screen readers do, would need to test if what you've implemented is now a standard behaviour (unless you have good evidence already to support this?). Going from https://a11ysupport.io/tech/aria/aria-busy_attribute, which is quite an old manual test and doesn't look at live region behaviours at all, it seems JAWS (at the time at least) might just ignore content with Testing of what screen readers actually do pending, feels like might be a case of simplifying what you've implemented?
What do you think? |
| target?.focus(); | ||
| } | ||
|
|
||
| #announceFocusedBusy(mutations: MutationRecord[]) { |
There was a problem hiding this comment.
I think this can be removed?
| }; | ||
|
|
||
| function getLiveRegionAttributes( | ||
| export function getLiveRegionAttributes( |
There was a problem hiding this comment.
If remove the focus behaviour then can drop the export
| if (target === container || targetAncestor === null) { | ||
| return { | ||
| atomic: atomic ?? DEFAULT_ATOMIC, | ||
| busy: busy ?? false, |
There was a problem hiding this comment.
nit: for consistency
| busy: busy ?? false, | |
| busy: busy ?? DEFAULT_BUSY, |
| const isBusy = targetElement.getAttribute("aria-busy") === "true"; | ||
|
|
||
| if (isBusy) { | ||
| return `${live}: busy`; | ||
| } |
|
Agreed — the WAI-ARIA specification defines
|
Summary
Implements support for the aria-busy state per the W3C WAI-ARIA 1.2 specification, addressing issue #36.
Changes
Accessibility Tree and Node Data:
Focused Element Announcements:
Live Region Processing:
Tests and Coverage:
Closes #36