Skip to content

aria-describedby is not assigned for tooltip if an aria-describedby is already present #2598

Open
@wbolduc

Description

@wbolduc

Bug report

Current Behavior

If the child of Tooltip.Trigger already has the aria-describedby property the tooltip is not correctly linked to the child
Eg. Before hover
image
After hover
image
Note the state is correctly applied but an additional id for the tooltip is missing in aria-describedby
Tooltip has some radix defined id not present on the trigger
image

Expected behavior

According to mdn aria-describedby is a list of ids. It follows that radix tooltip should correctly add it's own id to the trigger even if aria-describedby is already present

Reproducible example

Demo based on tooltip sample code

Suggested solution

Tooltip should add it's own id if the existing element already has aria-describedby. Maybe there should be a toggle for this behavior in case people are already using this behavior as is

Additional context

I think this is also present for other radix primitives like popout. I would imagine anything that slots may have this issue

Your environment

Repro in the linked code sandbox. Seems browser agnostic

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