#8740 closed bug (fixed)
Tooltip: Does not hide consistently with dynamically loaded content
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | minor | Milestone: | 1.11.4 |
Component: | ui.tooltip | Version: | 1.9.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Although it's better in 1.9.1 there are still times when tooltips either get stuck open. Most examples occur when a delegated event loads data into the tooltip from AJAX and the users mouse very briefly passes over the tooltip. Would a hover intent kind of delay help this. i.e. have an option to only show the tooltip if the mouse point is over the tip for a hundred milliseconds or so. In the same scenario I've also seen it flip it's behavior after quick pass. Not hovering shows the content and hovering hides it. Usually passing the mouse over the link a couple times fixes it. I don't know if any of these are really fixable. One possible speudo fix would be to track the element the tooltip is bound to and make sure the tooltip is hidden when the element is hidden or destroyed. This was in FireFox 16.0.1
Change History (31)
comment:1 Changed 10 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
comment:2 Changed 10 years ago by
Status: | pending → new |
---|
Sorry this took a bit, been busy. http://jsfiddle.net/BukmE/ To replicate, quickly pass the mouse pointer over the view link. After 500ms the tooltip will appear and not disappear. Closing the dialog will not make it go away either. Waving the mouse over the view link will eventually make it go away (if the 500ms timer where not there that is). Basically, if the callback function takes a little bit (in this case 500ms) it will induce the behavior. I know I'm using a hideous pause event that is straight from the devil, but that was done to invoke the behavior on a repeated basis. In the "real world" any call to an Ajax function that takes a more than a few ms will cause this. We see it repeatedly on fresh page load (no caches).
comment:3 Changed 10 years ago by
Update: After playing with it for a bit here's what I *think* is going on. If the callback function takes longer to respond than the users mouse is over the link, the problem occurs. Hope that helps.
comment:4 Changed 10 years ago by
Status: | new → open |
---|---|
Summary: | Tooltip still does not hide consistently. → Tooltip: Does not hide consistently with dynamically loaded content |
Thanks, I was able to verify this. Interestingly I was able to recreate this issue on Firefox 16 and Chrome 22 on Windows 7 but I cannot get it to happen on OS X regardless of browser.
comment:5 Changed 10 years ago by
Need to get rid of the while-pause and replace the dialog with just triggering focus programmatically. That would make it easier to track down the actual issue.
comment:6 Changed 10 years ago by
Played with this one a bit, the bug actually looks to be related to the setting of focus. Dialog does this automatically, but if I programmatically set focus on an element AND use a delay in the content
option the tooltip never goes away - http://jsfiddle.net/tj_vantoll/zGkxX/. If the content
option is simply a static value the bug is not present - http://jsfiddle.net/tj_vantoll/P4JWN/.
comment:7 Changed 10 years ago by
Looks like programmatic focus matches the 'focusin' event, but the event.type is actually 'focus'. Seems like a bug in core to me, but we can work around it for now: https://gist.github.com/19cd921fed1eb358dc0a
If that's okay, it also needs a unit test.
comment:8 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | open → closed |
Tooltip: Handle synthetic focusin events. Fixes #8740 - Tooltip: Does not hide consistently with dynamically loaded content.
Changeset: 1b503a237e1dc47739a8a451debbc86e169851e3
comment:9 Changed 10 years ago by
Tooltip: Handle synthetic focusin events. Fixes #8740 - Tooltip: Does not hide consistently with dynamically loaded content. (cherry picked from commit 1b503a237e1dc47739a8a451debbc86e169851e3)
Changeset: f4ce4d309c6384ccda68065bbbee5a4404385503
comment:10 Changed 10 years ago by
Milestone: | 1.10.0 → 1.9.2 |
---|
comment:11 Changed 10 years ago by
I may be missing something but this does not look fixed to me. http://jsfiddle.net/PkJrP/ Same code as my original above but changed the library to 1.9.2 Same problem. Quick hover over the link and the tooltop will stay open.
comment:12 Changed 10 years ago by
Milestone: | 1.9.2 → 1.10.0 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
It looks like the bug caused by explicitly setting focus was fixed in 1.9.2; I no longer see that problem. However there's definitely something still off here.
Test case against master - http://jsfiddle.net/tj_vantoll/Z2R43/. In this one I am no longer explicitly setting focus and I was able to recreate the issue on Chrome 23 and Firefox 16 on OS X).
To recreate: 1) Hover over the link with the cursor. 2) Leave the link with your cursor before the tooltip is fully faded in. 3) Occasionally the tooltip will not disappear and be stuck displaying indefinitely.
You might have to do it a few times to see the issue. After playing with this for a few minutes I was able to get the issue to happen fairly consistently.
comment:13 Changed 10 years ago by
Milestone: | 1.10.0 → none |
---|
comment:14 Changed 10 years ago by
Just wanted to confirm that I had the same issue just recently. Ajax based content endpoints, and if you moved on/off it quickly it stayed forever.
I temporarily fixed it, by adding some .mouseenter .mouseleave code to track the hover status, and then upon 'open', it checks if the mouse is still hovering or not, and only allows the open if so. Otherwise it issues a .close() to shut it down immediately. Hacked, but solves the issue.
comment:17 follow-up: 18 Changed 10 years ago by
Test case from lokicat in #9198: http://jsfiddle.net/tj_vantoll/nqJBf/
comment:18 Changed 10 years ago by
Thanks tj.vantoll. The lokicat fiddle describes the problem exactly. Just hope that it will be fixed soon.
comment:19 follow-up: 21 Changed 10 years ago by
I think the event handlers for events closing the tooltip are registered too late. I submitted a pull with suggested fix.
https://github.com/mziech/jquery-ui/commit/3b2c55d7136615a2802241225abf060c9a1bf795
comment:21 Changed 9 years ago by
Replying to mziech:
I think the event handlers for events closing the tooltip are registered too late. I submitted a pull with suggested fix.
https://github.com/mziech/jquery-ui/commit/3b2c55d7136615a2802241225abf060c9a1bf795
Thanks Marco for your patch. It fixed my problem. This needs to be in a release. Has it fallen off the radar? It's a serious bug for anyone using context functions.
comment:22 follow-up: 26 Changed 9 years ago by
Thanks for the patch Marco - it works! Still waiting for the pull request to be merged: https://github.com/jquery/jquery-ui/pull/1053
comment:23 follow-up: 25 Changed 9 years ago by
Still having the same issue while using the tooltip in a grid. The tooltip does not close if the movement of the mouse is swift if the data volume in the grid is high. I am currently using IE8 and 1.10.2 version of jquery UI.
comment:24 follow-up: 27 Changed 9 years ago by
Also encountered this problem, but mine is produced slightly differently. I have some drag-and-droppable elements, the droppable element has title (so it will trigger tooltip) when i drag an element on top of a droppable element, tooltip will show and when i release my mouse, another new tooltip will gets created, the previous tooltip will be stuck.
My workaround is much simpler and works wonder for simple tooltip.
open: function(event, ui) { $(ui.tooltip).siblings(".tooltip").remove(); }
Basically just remove any other stuck tooltips. HTH
comment:25 Changed 9 years ago by
Replying to shivamtandon24:
Still having the same issue while using the tooltip in a grid. The tooltip does not close if the movement of the mouse is swift if the data volume in the grid is high. I am currently using IE8 and 1.10.2 version of jquery UI.
Can you try my fix? https://github.com/jquery/jquery-ui/pull/1272
comment:26 Changed 9 years ago by
Replying to foodbaby:
Thanks for the patch Marco - it works! Still waiting for the pull request to be merged: https://github.com/jquery/jquery-ui/pull/1053
This fixed the issue for me (jQ 1.11.1 & jQ UI 1.10.4). I manually applied the patch. Thank goodness and thank you!
comment:27 Changed 9 years ago by
Replying to totszwai:
My workaround is much simpler and works wonder for simple tooltip.
open: function(event, ui) { $(ui.tooltip).siblings(".tooltip").remove(); }
Working fine with ".ui-tooltip" (instead ".tooltip") as selctor. Thank you!
I hope a fix coming soon. I use jQuery-UI 1.11.1
comment:28 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Tooltip: Register event handlers before content is loaded
Fixes #8740 Closes gh-1053 Closes gh-1456
Changeset: c4e367bb31c21d7c8b2701c626a92a2f13be5af4
comment:29 Changed 8 years ago by
Milestone: | none → 1.12.0 |
---|
comment:30 Changed 8 years ago by
Tooltip: Register event handlers before content is loaded
Fixes #8740 Closes gh-1053 Closes gh-1456 (cherry picked from commit c4e367bb31c21d7c8b2701c626a92a2f13be5af4)
Changeset: 88291ffc4d6a5f4762ae65e42de607f5588101dd
comment:31 Changed 8 years ago by
Milestone: | 1.12.0 → 1.11.4 |
---|
Thanks for taking the time to contribute to the jQuery UI project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket. To get you started, use this boilerplate: http://jsfiddle.net/ZgAqH/. Open the link and click to "Fork" (in the top menu).