ui5-dialog: Accessibility: using header slot causes broken aria-labelledby reference
See original GitHub issueDescribe the bug
The outermost <section>
element in the ui5-dialog
’s shadow DOM has aria-labelledby="ui5-popup-header"
. When using the ui5-dialog
’s header
slot instead of header-text
, any elements could be placed inside ui5-popup-header
. Simply referring to the header container in this scenario would render aria-labelledby
as useless.
To reproduce Steps to reproduce the behavior:
- Add
ui5-dialog
to the DOM - Use
header
slot withui5-button
andui5-title
- Note that
ui5-popup-header
in theui5-dialog
’s shadow DOM refers to the header container, not the actual element containing the header text.
Isolated example https://codesandbox.io/s/ui5-webcomponents-forked-rosol?file=/index.html
Expected behavior
Not sure if this is the most elegant solution, but it might be good to expose an aria-label
value as a parameter so that the developer can pass in a string as the screenreader label.
Screenshots
Context
- UI5 Web Components version: 0.29.4
- OS/Platform: Windows
Affected components <ui5-dialog>
Log output / Any errors in the console: None
Organization: SuccessFactors
Priority: Medium
- Is accessibility one (Screen Reader, Keyboard Handling)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Hello @agauyeung The fix is released with 0.29.15
Hi @agauyeung,
Thanks for reporting this issue! I have discussed the issue with our accessibility expert, therefore I am forwarding it to the coresponding team.
Regards, Ivaylo