Skip to content

Add API to define Tooltip aria link mode #8905

@TatuLund

Description

@TatuLund

Describe your motivation

There are occasional conflicts with accessibility specifications. Good case example is an icon only button. There is multiple ways to make them accessible. One can set aria label to the button or add tooltip, or both.

Naturally if using both, it is best practice not to use the same text, use label for prefix and tooltip for extended description.

However sometimes the split is artificial, and description itself is short and concise.

In this case it depends on interpretation if the aria label can be dropped. Some guidance says that it is ok, some other sources says that accessible name must be always present.

Technically screen reader and other assistive aids composes the assistive text from both, and from end user perspective there is no difference whether the text comes from aria label or description.

Having said that, sometimes this is more a compliance driven than what actually works driven, thus it should be possible to use Tooltip as a label if so needed.

Describe the solution you'd like

Add API to control how Tooltip is linked to target component:

Tooltip#setAriaLinkingMode(AriaLinking)

And AriaLinking is an enum of

AriaLinking.AriaLabelledBy
AriaLinking.AriaDescribedBy

Describe alternatives you've considered

Add simpler boolean API tooltip.setUseAriaLabelledBy(true)

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions