-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
🐛Bug: For tooltip, ignore delays when on a mobile device #196
Comments
Actually, tooltips should not work on mobile devices. For those, Popover should be used. |
I would encourage you think on this more though, and not follow Radix here. 1.) Responsive websites are the de facto standard, 2.) it's not particularly useful as an element with that intentional limitation, 3.) it's current behavior is almost perfect for desktop and mobile already--just needs the delay tweaked on mobile, and 4.) having gotchas in Melt elements that make them inconsistent from other elements will hinder the DX--at the very least, it needs a warning "Use only on non-touch devices", otherwise devs aren't going to anticipate this intentional limitation unless it's noted. |
It's an accessibility concern, rather than just following Radix and other libraries. From MDN:
I agree though that the docs should clearly specifiy this limitation! |
Your quote refers to the HTML But Melt's tooltip is not implemented as merely a |
By reading more into what I quoted, it even goes against me. It says the title attribute is inaccessible, not that the tooltip being activated by touch is. The WAI-ARIA guidelines do not say anything about touch, but do say about receiving focus... I think you've convinced me. Will think a bit on this. |
@jasongitmail one question, why did you prefer to use a tooltip rather than a popover? Reason I'm asking is, me and @huntabyte have been debating over this recently. I'm also wondering due to this issue: #276 In this issue, the button is both a tooltip trigger and a menu trigger. Which means, you'll never be able to see the tooltip in mobile, due to it correpsonding to an action that moves focus outside of the tooltip trigger. Also, this behaviour is inconsistent with the desktop behaviour. In desktop, if you already clicked the action, you hide the tooltip (in case it had been triggerred), and prevent it from showing further, unless the mouse moves out and back again from the trigger. Meanwhile, in touch devices, this proposed and implemented behaviour means that even after the action is executed, the tooltip persists there in case focus isn't changed afterwards, which is not something you'd expect after seeing the desktop behaviour. Continuing my research. looking over to the tooltip section in MDN, it is meant to provide additional information, and not be directly requested. Meaning, something like a ⓘ shouldn't be called with a tooltip (which is what I assume you were using, or something similar): We also debated over this article: https://sarahmhigley.com/writing/tooltips-in-wcag-21/ All this information is making me rethink this re-implemented behaviour, and I'm thinking of reverting it. I'd like your thoughts though! |
Linking the #279 PR as a resolution. |
@TGlide No preference for tooltip vs popover. My goal was to help test MeltUI for DX/UX and avoid unexpected behaviors.
I researched this more and it seems super unclear.
For practical purposes:
TDLR No clear answer. I lean toward the practical approach primarily b/c seems more intuitive DX/UX, and secondarily b/c W3C's example is touch accessible, but maybe go with whichever you feel is best since it's unclear, and just document the foot guns on the tooltip docs. |
Hey @jasongitmail, thanks for your feedback! I agree that it can be a bit confusing! It did take a lot of research for sure. Please note we still have an option to have the tooltip work on mobile. By setting We'll be also dispatching custom event listeners for every listener we currently have, as well as controlled usage, so the ignorable delays should be achievable. It's just not something I think should be on by default. I thought of having it configurable, but I think the event listeners I mentioned should be more than enough. |
Describe the bug
When on a mobile device, tapping the tooltip waits the specified delay, but should show it immediately.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tooltip should be visible immediately when tapped by a user on a mobile device.
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: