SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.56k stars 267 forks source link

Dialog to support the alertdialog role for a11y #5119

Closed lormanlau closed 2 years ago

lormanlau commented 2 years ago

Feature Request Description

A clear and concise description of what feature is missing. Is your feature request related to a problem? Please describe.

Currently the role for the ui5 dialog is hard coded for role of the section to be dialog https://github.com/SAP/ui5-webcomponents/blob/ddc1e3909e624aa1643e424284ec1144e8b81bb9/packages/main/src/Popup.hbs#L4 We would like this to be changeable to alertdialog when using the dialog as an alert popup.

Proposed Solution

A clear and concise description of the solution you would like to have. Adding a parameter for the ui5 webcomponent dialog to apply and role necessary.

Proposed Alternatives

A clear and concise description of any alternative solutions or features you've considered. Only allowing a few roles to be available to the dialog.

Additional Context

Add other context or screenshots related to the feature request here. N/A

Priority

A clear and concise description of the impact/urgency of the required feature.

Stakeholder Info (if applicable)

unazko commented 2 years ago

Hello @SAP/ui5-webcomponents-topic-rd,

This is a request for a public API related to the ui5-dialog component, in order to set role to the dialog popover element other than the default one. By the given example it could be role="alertdialog" instead of the hardcoded role="dialog". https://developer.mozilla.org/en-US/docs/web/accessibility/aria/roles/alertdialog_role Could you please evaluate this possibility?

Best Regards, Boyan Rakilovski

nikolay-kolarov commented 2 years ago

Hello @lormanlau,

Could you please provide more information what you are trying to achieve? In UI5 the dialog can be "alertdialog" or "dialog", depending on the type.

But the role="alert" is only used in the MessageToast as it behaves as live region. And this is not applicable to the dialogs in general.

Thanks, Nikolay

lormanlau commented 2 years ago

Hi @nikolay-kolarov,

We are trying to use the dialog as an warning message for the user. I believe "alertdialog" exactly what we needed to achieve this.

Thanks, Lorman

olannyv commented 2 years ago

It turns the right solution is to extend the Dialog with a state property - which will determine the right Aria attributes, not only for Alert, but also for other state-Dialogs. Corresponding backlog item BGSOFUIRODOPI-2838 is created, but it will take about a few weeks to implement it

kskondov commented 2 years ago

This issue is addressed with the following pull request https://github.com/SAP/ui5-webcomponents/pull/5587