Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltip doesn't work on iOS #682

Open
poisa opened this issue Nov 15, 2024 · 2 comments
Open

Tooltip doesn't work on iOS #682

poisa opened this issue Nov 15, 2024 · 2 comments

Comments

@poisa
Copy link

poisa commented Nov 15, 2024

You can test this in the official documentation https://fluxui.dev/components/tooltip

The first time you try a tooltip there is a chance that it shows properly but often it does not. All subsequent times it fails.

I can reproduce this every single time in both Safari and Chrome for iOS 18.1 on an iPhone 16 Pro Max.

@calebporzio
Copy link
Contributor

Ah yep, I see what you're saying. Question for you: what is the behavior you would expect from tooltips on mobile devices?

A) Not show at all (because there's no hover on touch devices)
B) Show on tap (and allow the thumb press to trigger click listeners as well)
C) Show on first tap, and prevent underlying click until second tap
D) Show on press and hold

Here are two examples of different behaviors I found around the web:

  1. GitHub: GitHub's tooltips are CSS based and show when a button is focused. So the tooltip will show if you press or hold a button, and the button will receive the press simultaneously: https://github.com/livewire/livewire

Image

  1. Radix UI: The Radix tooltip seems to be completely disabled on mobile: https://www.radix-ui.com/primitives/docs/components/tooltip

Just want to see what people expect before we explore this more.

@poisa
Copy link
Author

poisa commented Nov 22, 2024

I would go with option B: show on tap and allow the thumb press to trigger click listeners as well.

I wouldn't ever use a tooltip for buttons to be honest, but that may just be personal preference. I think the expectation for buttons is to perform the action the button suggests and nothing else. If you want to show a tooltip, sure, but do the expected button action too.

I was thinking more in terms of things like these, where the information is most commonly found on tooltips than an expandable text area or similar:

Image

In the above case, it's information that you need only the first time that you use the form, so it would clutter the UI if we had it always be present.

As far as the other options, here are my opinions:

A) Not show at all (because there's no hover on touch devices)

This is the one I like the least as it requires two different designs, for mobile and bigger screens.

C) Show on first tap, and prevent underlying click until second tap

This messes with the normal expectation of a control. If it's a button we should be able to tap/click it and have it do what it's expected to do.

D) Show on press and hold

This one is tricky because it depends on how mobile implements selections. In iOS if you hold, you get the text selection options, dictionary, translation, etc., so it looks messy. I like this in terms of usability but in the real world I'd avoid it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants