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

[SF][A11y][ui5-button] tooltip is announced twice when the button is focused #4689

Closed BennyHuang closed 2 years ago

BennyHuang commented 2 years ago

Bug Description

The tooltip of ui-button is announced twice. I observe there is one title for ui5-button element and one title for button element. Maybe just one title is enough.

Expected Behavior

Focused button should be read once. Repetitive announcements should be avoided.

Isolated Example

If possible, please provide an isolated example by forking https://codesandbox.io/s/affectionate-colden-6bt0t

Context

Priority

The priority indicates the severity of the issue. To set the appropriate priority consider the following criteria:

Note: The priority might be re-evaluated by the issue processor.

Stakeholder Info (if applicable)

Shtilianova commented 2 years ago

Thank you for your ticket. This is expected behavior because has been read both the icon and tooltip.

elenastoyanovaa commented 2 years ago

Hello @BennyHuang ,

We have analysed the issue again and the actual root cause of the repetitive speech output comes from setting the title attribute on 2 levels. Once the title attribute is set on the ui5-button, coming from the tooltip property. The second time we set it internally inside the shadow DOM to the native button element in order to make this button accessible by having an accessible name (via the title).

We will discuss the issue and inform you when we have a solution for it. Thank you for reporting!

ilhan007 commented 2 years ago

Thank you @elenastoyanovaa

Hello @SAP/ui5-webcomponents-topic-b as you can see from the screenshot the title attribute is set on the ui5-button and on the button tags, causing repetitive speech output:

Screenshot 2022-02-03 at 16 01 01

I suggest discussing this internally, some options that we already discussed with @elenastoyanovaa are removing the "title" attribute forwarding and exposing a tooltip property to avoid this duplication, or make use of the newly added accesibilityAttributes property. Once you have a proposal, we can discuss it together.

rchrdchn commented 2 years ago

Hey team – just following up on this issue. When could we expect the fix for this issue?

ilhan007 commented 2 years ago

Hello @rchrdchn we addressed your issue with following change https://github.com/SAP/ui5-webcomponents/pull/4737.

With this change we introduce a new tooltip property that needs to be set (instead of title) on the web component to avoid two "title" attributes from being set, causing repetition in the announcement. This will be part from 1.2.0 version and will be released 28.02-2.03.

rchrdchn commented 2 years ago

Thank you @ilhan007!