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

[BUG] - Tooltip stays open more than it should #4301

Open
Ejdyz opened this issue Dec 9, 2024 · 13 comments · May be fixed by #4482
Open

[BUG] - Tooltip stays open more than it should #4301

Ejdyz opened this issue Dec 9, 2024 · 13 comments · May be fixed by #4482

Comments

@Ejdyz
Copy link

Ejdyz commented Dec 9, 2024

NextUI Version

@nextui-org/[email protected] (or the one that is in the documentation)

Describe the bug

When you rapidly move cursor over elements with Tooltip element the tooltip stays sometimes open.

image

In the provided image, there are multiple buttons that I moved my mouse over.

Your Example Website or App

https://nextui.org/docs/components/tooltip#placements

Steps to Reproduce the Bug or Issue

  1. Go to provided URL link
  2. Scroll to Placements
  3. Rapidly move mouse cursor over those buttons and you should see that some of the tooltips are staying longer then expected

Expected behavior

The tooltips should close after while and when I dont hover over any of them the Tooltip should close.

Screenshots or Videos

image
image
clideo_editor_8bd713f5ec1a413bafb1bd040230c624

Operating System Version

Ubuntu 24.04.1 LTS

Browser

Chrome

Copy link

linear bot commented Dec 9, 2024

@wingkwong
Copy link
Member

I couldn't reproduce the issue on the documentation. Can you please try again since we've deployed a new version?

@Ejdyz
Copy link
Author

Ejdyz commented Dec 11, 2024

I did replicate it sometimes, but it was harder this time. I made Youtube video where are shown my successful attempts of recreating the issue.

YouTube video

The video is not public so only those one who have link can access it.
I uploaded it to youtube because there you can use "," and "." buttons to move backwards and forward in the video by frames.

The problem I think happens when two Tooltips are opened at the almost same time. I don't know if this is the case, but by the video it looks like that.

In my project i have sidebar navigation with buttons where each of them have tooltip with info where the button will navigate and sometimes those tooltips stuck there and that's how i came across this issue.

I hope this helps to solve this issue.

@J4v4Scr1pt
Copy link

I also have this issue now.

@ethylon
Copy link

ethylon commented Dec 12, 2024

This is a recurring problem on our website. I fixed it by applying a delay on all of our tooltips.

@J4v4Scr1pt
Copy link

J4v4Scr1pt commented Dec 12, 2024

This is a recurring problem on our website. I fixed it by applying a delay on all of our tooltips.

Recurring you say.. 🤔. Never had this issue before until 2.6. But have only used NextUI for the last 1.5 years.

@Ejdyz
Copy link
Author

Ejdyz commented Dec 12, 2024

This is a recurring problem on our website. I fixed it by applying a delay on all of our tooltips.

Which delay you added? Delay for opening or closing?

@AndreyMay
Copy link

started happening after v2.6 upgrade

@J4v4Scr1pt
Copy link

Is there any updates to this? Tested in the docs again and it still happens. In the image left-end is stuck until you hover the button again.
image

@AndreyMay
Copy link

AndreyMay commented Dec 18, 2024

This is a recurring problem on our website. I fixed it by applying a delay on all of our tooltips.

The issue seem to happen when delay and closeDelay are set to 0. Moving over / quickly passing the element will make the tooltip "stuck".
This config seem to get rid of the problem closeDelay={0} delay={10}
EDIT: I take that back, it does not fix the problem, just changes the timing of the problem. disableAnimation however does seem to fix it.

@Connorelsea
Copy link

Connorelsea commented Dec 29, 2024

I am also having this issue. I experimented with a few different delays and still had the issue. The example in my video is very forced but it easily happens from just navigating around the page normally (even with a delay, the tooltip sequence and unwanted retention eventually begins)

Screen.Recording.2024-12-29.at.3.02.41.AM.mov

Here's another video of it being replicated on the doc website

Screen.Recording.2024-12-29.at.2.59.07.PM.mov

@pkfln
Copy link

pkfln commented Jan 2, 2025

The problem appears to occur more frequently when Tooltips are triggered on a high refresh rate screen.

@Connorelsea
Copy link

Connorelsea commented Jan 2, 2025

I have a hunch that unmounting of the AnimatePresence container in the tooltip code could be causing it, have dealt with some similar framer-motion issues myself in recent projects. Currently the AnimatePresence is only rendered when isOpen is true but the main conditional rendering needs to be a child of a constant AnimatePresence.

I will test this and try to make a PR as soon as I get a free moment to get a local version of NextUI running.

Update: I opened a PR with a fix. The issue persisted after the AnimatePresence fix, but adding a key to the main motion div to make sure it is properly tracked when rendering seems to have fixed the issue.

Example via Claude:

image

@Connorelsea Connorelsea linked a pull request Jan 2, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

7 participants