File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,19 @@ $.widget( "ui.tooltip", {
118
118
target = $ ( event ? event . target : this . element )
119
119
. closest ( this . options . items ) ;
120
120
121
- // if ui-tooltip-id exists, then the tooltip is already open
122
- if ( ! target . length || target . data ( "ui-tooltip-id" ) ) {
121
+ // No element to show a tooltip for
122
+ if ( ! target . length ) {
123
+ return ;
124
+ }
125
+
126
+ // If the tooltip is open and we're tracking then reposition the tooltip.
127
+ // This makes sure that a tracking tooltip doesn't obscure a focused element
128
+ // if the user was hovering when the element gained focused.
129
+ if ( this . options . track && target . data ( "ui-tooltip-id" ) ) {
130
+ this . _find ( target ) . position ( $ . extend ( {
131
+ of : target
132
+ } , this . options . position ) ) ;
133
+ // TODO: Do we need to unbind the mousemove handler here?
123
134
return ;
124
135
}
125
136
@@ -251,7 +262,7 @@ $.widget( "ui.tooltip", {
251
262
target . removeData ( "tooltip-open" ) ;
252
263
target . unbind ( "mouseleave.tooltip focusout.tooltip keyup.tooltip" ) ;
253
264
254
- // TODO use _off
265
+ // TODO use _off (see associated TODO in open())
255
266
this . document . unbind ( "mousemove.tooltip" ) ;
256
267
257
268
this . closing = true ;
You can’t perform that action at this time.
0 commit comments