Accessibility issues with expand/collapse buttons in WebHelp Responsive output
Posted: Tue Jan 31, 2023 11:19 pm
We've noticed that the span elements used to display the expand/collapse buttons for expandable elements, such as sections and articles, have the aria-label attribute set to 'expand' or 'collapse' (in English). When using the keyboard to tab to one of these span elements, a screen reader (such as NVDA) announces that it's a button and speaks only the word 'expand' or 'collapse', so the user has no information about what content is associated with the expand or collapse action.
We have topics that contain many expand/collapse buttons, and the lack of more information about what the button is associated with will make it difficult for screen reader users to easily navigate the content. This is even more apparent if a screen reader user brings up a dialog that lists all buttons on a page, since that list will simply contain the text 'expand' or 'collapse' for each of the expand/collapse buttons.
In a post (post48716.html?hilit=wh_expand_btn#p48716) from 2018, another user had asked about whether there's a way to include the actual trigger text in the span element, for example including the section title in a span element for expanding/collapsing a section. Since we're involved in a companywide mandate to make our products accessible, we've gone ahead and written some custom javascript to embed the appropriate trigger text inside the span element that represents the button. The span element for the visible button is then added as a child to this span element (we added javascript code and CSS to handle this), as in the following sample:
<span class="wh_expand_btn" role="button" aria-expanded="false" tabindex="0">
<span class="av_wh_expand_icon" aria-hidden="true"/>
Trigger text:
</span>
We're wondering if the Oxygen team is aware of this accessibility issue and perhaps has this on a road map?
Regards
We have topics that contain many expand/collapse buttons, and the lack of more information about what the button is associated with will make it difficult for screen reader users to easily navigate the content. This is even more apparent if a screen reader user brings up a dialog that lists all buttons on a page, since that list will simply contain the text 'expand' or 'collapse' for each of the expand/collapse buttons.
In a post (post48716.html?hilit=wh_expand_btn#p48716) from 2018, another user had asked about whether there's a way to include the actual trigger text in the span element, for example including the section title in a span element for expanding/collapsing a section. Since we're involved in a companywide mandate to make our products accessible, we've gone ahead and written some custom javascript to embed the appropriate trigger text inside the span element that represents the button. The span element for the visible button is then added as a child to this span element (we added javascript code and CSS to handle this), as in the following sample:
<span class="wh_expand_btn" role="button" aria-expanded="false" tabindex="0">
<span class="av_wh_expand_icon" aria-hidden="true"/>
Trigger text:
</span>
We're wondering if the Oxygen team is aware of this accessibility issue and perhaps has this on a road map?
Regards