aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-05-29 19:21:31 -0400
committerScott González <scott.gonzalez@gmail.com>2011-05-29 19:21:31 -0400
commit133fba2ad9b588233f7c7303619ac42351f08926 (patch)
tree9e409d95e73abebdbe4a276697ecc61b09fcd287 /ui
parentade1fe18875dfec29a70072360841c5466663291 (diff)
downloadjquery-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.js7
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;
}