-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Reopen - Suggested fix for #8740 #992
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
Reopen - Suggested fix for #8740 #992
Conversation
…0 - Tooltip: Does not hide consistently with dynamically loaded content.
setTimeout(function () { | ||
ok(!$( "#" + element.data( "ui-tooltip-id" ) ).is( ":visible" ), "Tooltip should not display" ); | ||
start(); | ||
}, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2nd argument can be omitted here.
This looks good and I'd like to land it. @scottgonzalez Any concerns? |
@@ -183,18 +183,21 @@ $.widget( "ui.tooltip", { | |||
that = this, | |||
eventType = event ? event.type : null; | |||
|
|||
this._registerCloseHandlers( event, target ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a bad time to bind event handlers. The content may be changed any number of times while the tooltip is open.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@scottgonzalez Good catch. I verified that if you update the content with this approach, close
will be called multiple times. @mziech Could you see if the close handlers could be bound in _open
and still fix the underlying issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your input. I implemented a test case to verify that the close handler is only called once. Indeed, it fails. Let me see whether I can fix this.
I don't think moving the close handler back to _open
fixes the initial problem, since we need to detect that the user left the tooltipped element before the tooltip is actually displayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually open
(without underscore) seems like a better place to register the close handlers ...
The commit and CLA have different email addresses. Can you please get them to match either by updating your git config and sending a new commit or signing the CLA again with the email address you're using in git? |
Thanks for you comments! I used different git installations for my contribution but I cannot really recall which mail address I used to sign the CLA. This pull request is replaced by #1053 which incorporates your suggested changes and a commit with a different mail address. |
Tooltip: Register event handlers before content is loaded. Fixes #8740 - Tooltip: Does not hide consistently with dynamically loaded content.
See http://bugs.jqueryui.com/ticket/8740
I don't really know whether creating a new pull-request is necessary or whether the old one (#973) could be re-opened. At least I haven't found a way to reopen the old one. If this would've been possible, let me know.