a11y issue with ui5-panel when accessible-role="Region" and aria-labelledby provided
Describe the bug When using ui5-panel with custom header, aria-labelledby attribute and accessible-role as "Region", a div with role as "region" get created but the aria-labelledBy attribute is not passed to it. So those regions are missing accessible names. ie the aria-labelledby is only present on the UI5 tag and not on the div with role="region" and hence these regions are not recognised with accessible names by both NVDA and JAWS
To reproduce Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/ui5-webcomponents-forked-x3k7l?file=/index.html
- Turn on NVDA screen reader and open the Element dialog (NVDA+f7)
- Go to landmarks tab and see that the region does not have accessible name
Isolated example https://codesandbox.io/s/ui5-webcomponents-forked-x3k7l?file=/index.html
Expected behavior aria-labelledby needs to be present on the div with role="region" for them to be recognised by screen readers with a name.
Screenshots If applicable, add screenshots to help explain your problem.
Context
- UI5 Web Components version 0.29.6
- OS/Platform: NA
- Browser (if relevant): NA
- Other information: {...}
Affected components (if known) ui5-panel
Organization: (if applicable) Success Factors
Priority: (optional) (Low, Medium, High or Very High)
Setting priority would indicate the importance of the issue and would help the process of dispatching and processing.
To set the appropriate priority, you need to consider the impact and if the issue:
- Breaks entire application or system - High and Very High
- Is accessibility one (Screan Reader, Keyboard Handling) - Medium and High
- Is functional one and makes a single component unusable - Medium and High
- Is visual, styling one - Low and Medium
Note: the priority would be re-evaluated by the issue processors, according to the project internal criterias
Business impact: (mandatory for "Very High")
Hello @SAP/ui5-webcomponents-topic-rl can you please check this accessibility issue with the ui5-panel
Hello @Ankitadoshi ,
In order to provide an accessible name to the element with role region, you could use the accessible-name property which is applied to the element with accessible role. You can check it here: https://sap.github.io/ui5-webcomponents/master/playground/components/Panel/
The aria-labelledby support was previously available for a while, but it lead to a repetitive speech output: When focusing an element which has an aria-labelledby attribute on custom element level and this aria-labelledby is passed to the root element with the accessible name, the screen reader would read the label twice. You can have more information regarding the new property and the decisions made here: https://github.com/SAP/ui5-webcomponents/pull/2860