diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-05-29 19:21:31 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-05-29 19:21:31 -0400 |
commit | 133fba2ad9b588233f7c7303619ac42351f08926 (patch) | |
tree | 9e409d95e73abebdbe4a276697ecc61b09fcd287 /ui | |
parent | ade1fe18875dfec29a70072360841c5466663291 (diff) | |
download | jquery-ui-133fba2ad9b588233f7c7303619ac42351f08926.tar.gz jquery-ui-133fba2ad9b588233f7c7303619ac42351f08926.zip |
Tooltip: Don't close tooltips on mouseleave if the element is still focused.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.tooltip.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index c5d9508f7..44398a871 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -56,7 +56,8 @@ $.widget( "ui.tooltip", { target = $( event ? event.target : this.element ) .closest( this.options.items ); - if ( !target.length ) { + // if aria-describedby exists, then the tooltip is already open + if ( !target.length || target.attr( "aria-describedby" ) ) { return; } @@ -131,7 +132,9 @@ $.widget( "ui.tooltip", { target.attr( "title", target.data( "tooltip-title" ) ); } - if ( this.options.disabled ) { + // don't close if the element has focus + // this prevents the tooltip from closing if you hover while focused + if ( this.options.disabled || document.activeElement === target[0] ) { return; } |