There are various accessibility problems with the ToggleCompositeField right now:
- Uses an interactable
h4 element instead of a button element
- Includes a
<a href="#"> element inside the h4 - but since the h4 is tabbable the link is redundant
- Missing a bunch of appropriate
aria attributes to indicate to screen reader users what they're focused on and what it does when activated (aria-expanded etc)
Probably makes sense to follow the W3C accordion pattern for this. There's also the W3C Disclosure pattern which is similar.
Related