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

Add option to open tooltip on long press #49

Open
ceopaludetto opened this issue Dec 6, 2024 · 1 comment
Open

Add option to open tooltip on long press #49

ceopaludetto opened this issue Dec 6, 2024 · 1 comment

Comments

@ceopaludetto
Copy link

Hi, thank you for the awesome library. Currently I'm developing a design system based on material design 3. The general recommendation for opening a tooltip on mobile is to tap and hold instead of just tapping, can we have a prop for trigger component to only open the tooltip on long press? Also it would be awesome to close only after timeout instead of closing on tap again, what you think?

Screenshot 2024-12-06 at 12 17 00

Reference: https://m3.material.io/components/tooltips/guidelines#00e87770-86d0-436d-b50b-436ff3cefe75

@mrzachnugent
Copy link
Collaborator

mrzachnugent commented Dec 10, 2024

Hey @ceopaludetto, you can achieve this with a Context Menu for Mobile. For the timeout feature, you can use this Common Pattern to set a timeout in the callback function for onLongPress to close the it with its ref.

For the web, you can continue to use the Tooltip.

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