Skip to content

[tern addon] Improve tooltip UX#3055

Closed
cpetrov wants to merge 1 commit intocodemirror:masterfrom
eclipsesource:improveTooltipUX
Closed

[tern addon] Improve tooltip UX#3055
cpetrov wants to merge 1 commit intocodemirror:masterfrom
eclipsesource:improveTooltipUX

Conversation

@cpetrov
Copy link
Copy Markdown

@cpetrov cpetrov commented Jan 28, 2015

Call the clear() function only after a mouse move has been triggered and
not just after a timeout has passed. This can make longer documentation
texts easier to read.

Extend the clear() function timeout, so that the user has enough time to
move the mouse pointer to the [doc] link.

Call the clear() function only after a mouse move has been triggered and
not just after a timeout has passed. This can make longer documentation
texts easier to read.

Extend the clear() function timeout, so that the user has enough time to
move the mouse pointer to the [doc] link.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't tooltip appear because of mouse move in the first place?

Movement might continue for a few pixels after the tooltip shown, triggering the event immediately anyway.

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Jan 29, 2015

I agree the current situation isn't great, but I am not sure that this is a very good solution (and share @mihailik's concern). I'll think about it some more when I have time, and am open to other ideas and/or examples of other UIs that solve a similar problem.

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Jan 30, 2015

What do you think of the attached patch? It makes it so that, after 1.7 seconds, if the mouse isn't over the tooltip, it is hidden. If it is, it stays until the mouse leaves.

@cpetrov
Copy link
Copy Markdown
Author

cpetrov commented Jan 30, 2015

@marijnh Thank you, this solution would work out great for our needs.

@mihailik
Copy link
Copy Markdown
Contributor

The 'mouseout' event bubbles up (see MDN below), so your handler for that event will fire even if you move your mouse from one tooltip child to another. The MDN article suggests using 'mouseleave' instead.

https://developer.mozilla.org/en-US/docs/Web/Events/mouseout

It also could be sensible to remove the tooltip on editor losing focus and editor scrolling.

@mihailik
Copy link
Copy Markdown
Contributor

Sorry, scratch that. CodeMirror.contains takes care of the mouseout for child elements. I'll add a separate pull req. for losing focus and scrolling.

@marijnh marijnh closed this Feb 2, 2015
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 this pull request may close these issues.

3 participants