cengage / react-magma

https://react-magma.cengage.com
MIT License
21 stars 12 forks source link

A11y Fail: Accordion - Lose focus on expand/collapse all #1386

Closed orion-cengage closed 1 month ago

orion-cengage commented 2 months ago

CENG_1951

https://react-magma.cengage.com/version/4.5.0/api/accordion/#controlled_accordion

Issue:

In the Controlled Accordion example, when pressing the "Expand All" button, all of the accordions in the set expand. However, focus is no longer set on anything and the next Tab stop moves to the "Collapse All" button, while the "Expand All" button is in a disabled state. Then when pressing the "Collapse All" button, focus is again not set and the next Tab stop moves to the first accordion button.

Suggestion:

For this control, consider using one button that changes its label from "Expand All" to "Collapse All". When the button is activated, focus should remain on it (which should be evident via a focus indicator).

silvalaura commented 1 month ago

This should update both of these examples:

silvalaura commented 1 month ago

Looks good ✅