Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Reopen - Suggested fix for #8740 #992

wants to merge 1 commit into from

Conversation

mziech
Copy link
Contributor

@mziech mziech commented May 19, 2013

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.

…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);
Copy link
Member

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.

@tjvantoll
Copy link
Member

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 );
Copy link
Member

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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 ...

@scottgonzalez
Copy link
Member

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?

@mziech
Copy link
Contributor Author

mziech commented Aug 10, 2013

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.

@mziech mziech closed this Aug 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants