Hover tooltip disappears when try to hover on the tooltip

When I try to move the mouse on the hover tooltip, the tooltip disappears. Its hard to hover on the tooltip. This problem is similar to this issue posted here:

Is there a solution to this problem?

Does the problem occur for you in the editor at the bottom of this example? If so, please describe in detail how you’re moving onto the tooltip. If not, what are you doing differently that produces the issue?

I think you got it wrong. I am using the Hover Tooltip extension. In the hover tooltip, there are only three parameters: hideOn, hideOnChange, and hoverTime but no parameter for delay. I want to set a delay before hiding the tooltip as I have some clickable items inside it. When I hover over a word the tooltip appears, but by default when I move the cursor away from the word the tooltip hides after 0.5 second. So, if the user isn’t quick enough, they can’t click on the item. How can we add a delay before hiding the tooltip?

The idea is that if the user moves the pointer from the word to the tooltip, the cursor is on (or near) one of those two the whole time, and the tooltip will not hide. What is going wrong with this approach in your case?

Hi @Marijn,

Thank you for your prompt response. I have investigated the issue further and observed the following behavior:

The tooltip functions as expected on the first line. However, for subsequent lines (e.g., the 2nd, 3rd, etc.), navigating to the tooltip becomes problematic. Any cursor movement over the same text causes the tooltip to disappear instantly and reappear only when the cursor movement stops.

To illustrate the issue, I have created a reproducible example on StackBlitz, which you can find here.

Additionally, I have attached a GIF demonstrating the behavior for your reference. Could you please review and share your insights on this matter?

Thank you in advance for your assistance!

codemirror-issue

Your test code is setting the end position of the hovered range to a hard-coded 4. This will make the library consider any positions beyond 4 to be outside of the hovered area, and thus close the tooltip early. Fix that, and these should work better.

Hi @Marijn,

Thank you for your prompt response and for providing a solution. I did the changes you mentioned and I’m happy to confirm that the solution works perfectly and resolves the issue.

I truly appreciate your support and guidance! Thanks a lot…!