Collapse plugin improved accessibility using aria roles and states / keyboard listeners
Created by: bassettsj
Again from the paypal/bootstrap-accessibility-plugin, these changes should be added to the documentation and the JS plugin.
Collapse
- Add
tab role, aria-selected,aria-expanded,aria-controls, and tabIndex for collapse tab. - Add ARIA roles of
tabPanel, tabIndex,aria-hidden, andaria-labelledByfor collapsible panel. Add role of tabList and aria-multiselectable for collapse container div.- Dynamically flip tabIndex, aria-selected, and
aria-expandedfor tab when it is activated and add aria-hidden to hide the previously visible collapse tabpanel. - Add keydown event listener for the collapse component to work with keyboard.