Skip to content
Browse files

Tooltip: Only check if the element is active if the event that is cau…

…sing the tooltip to close is not focusout.
  • Loading branch information
scottgonzalez committed Apr 30, 2012
1 parent b8b0c52 commit dbf31da79f30740136c2cb3b20269a7eabf9af67
Showing with 4 additions and 1 deletion.
  1. +4 −1 ui/jquery.ui.tooltip.js
@@ -179,7 +179,10 @@ $.widget( "ui.tooltip", {

// don't close if the element has focus
// this prevents the tooltip from closing if you hover while focused
if ( !force && this.document[0].activeElement === target[0] ) {
// we have to check the event type because tabbing out of the document
// may leave the element as the activeElement
if ( !force && event && event.type !== "focusout" &&
this.document[0].activeElement === target[0] ) {

1 comment on commit dbf31da


This comment has been minimized.

Copy link

@jzaefferer jzaefferer commented on dbf31da Apr 30, 2012

Nice. Will keep that in mind next time we use document.activeElement somewhere.

Please sign in to comment.
You can’t perform that action at this time.