Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Use a more reliable way to determine whether focus is in an inline widget #2422

Merged
merged 1 commit into from
Dec 20, 2012

Conversation

njx
Copy link

@njx njx commented Dec 20, 2012

Unit tests for inline widgets fail intermittently when run as part of the entire test suite. The problem appears to be that the way we're determining whether a widget currently has focus isn't entirely reliable for some reason. This pull request uses a different method that seems like it ought to be reasonably foolproof.

@ghost ghost assigned jasonsanjose Dec 20, 2012
@njx
Copy link
Author

njx commented Dec 20, 2012

BTW, note that $.contains() requires raw DOM nodes (not jQuery objects), which is why I'm using this.$htmlContent[0].

@jasonsanjose
Copy link
Member

Looks good. Merging.

jasonsanjose added a commit that referenced this pull request Dec 20, 2012
Use a more reliable way to determine whether focus is in an inline widget
@jasonsanjose jasonsanjose merged commit 128851f into master Dec 20, 2012
@jasonsanjose jasonsanjose deleted the nj/fix-inline-focus branch December 20, 2012 22:47
@peterflynn
Copy link
Member

That's very strange -- looking at the jQuery code, it just does elem === elem.ownerDocument.activeElement so you'd think it would be equivalent. But hey, whatever works!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants