Skip to content

Composite: Doesn't work when render is a Tooltip #65615

@mirka

Description

@mirka

Composite does not correctly manage roving tab index when Composite.Item's render prop is a Tooltip. For example, when you have a composite item like this:

<Composite.Item
  render={
    <Tooltip text="Tooltip">
      <button>Button</button>
    </Tooltip>
  }
/>

The workaround is to wrap the Tooltip around the Composite.Item:

<Tooltip text="Tooltip">
  <Composite.Item render={<button>Button</button>} />
</Tooltip>

This problem does not manifest when the Tooltip is used internally in a component, like:

<Ariakit.CompositeItem
  render={
    <Button label="Tooltip" showTooltip>
      Button
    </Button>
  }
/>

The problems reproduce in raw Ariakit Composite (sandbox demo).

What is your proposed solution?

These may be limitations that don't necessarily need to be fixed, but we should at least document the workarounds.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions