I just shipped the new feature for accordion accessibility to my open source accessibility package https://lnkd.in/duuhaVtd. This feature helps visually impaired users to navigate interacting with accordions, by enabling screen reader support to inform the users of information about the accordion like the current state, and purpose. The states are either expanded or not expanded. The package function updates the aria-pressed, aria-expanded and aria-label attributes of the accordion's trigger button.
The function accepts 3 arguments; an array of objects with information about each accordion in the collection, a shared class of all the accordion triggers, and the index position of the currently clicked trigger relative to the main accordion container and other trigger buttons.
Absolutely true. While drag-and-drop is intuitive, it can exclude users with motor skill limitations or those who rely on assistive technologies.