Skip to content

Option to show tooltip on touch devices #2393

@rChaoz

Description

@rChaoz

🚀 Feature request

Provide an update to Tooltip to allow it to open immediately on tap, closing on further outside interactions.

🧱 Problem Statement / Justification

In some cases, it is desired to have a tooltip that also works on mobile, where there is no hover. Currently, this is not possible, and the only way to display important info (that can't be missing on mobile) is using a popover.

A use-case is the little info icon that commonly sits next to input fields or displayed data. What better example to show this in action if not YouTube:

Image

when hovered on desktop/tapped on mobile

Image

✅ Proposed solution or API

An optional prop that, when set to true, enables this behaviour (e.g. showOnTap). It should be disabled by default as this is not always wanted, e.g. tooltips on interactive elements.

↩️ Alternatives

A combined Popover + Tooltip. This is quite complicated to achieve (ID handling, close one when the other opens...) and doesn't have the correct behaviour, as it also opens on click on desktop, which is not intended.

📝 Additional Information

I'm happy to make a PR for this if that's okay 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions