File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,18 @@ $.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 ) ) ;
123
133
return ;
124
134
}
125
135
@@ -250,9 +260,7 @@ $.widget( "ui.tooltip", {
250
260
251
261
target . removeData ( "tooltip-open" ) ;
252
262
this . _off ( target , "mouseleave focusout keyup" ) ;
253
-
254
- // TODO use _off
255
- this . document . unbind ( "mousemove.tooltip" ) ;
263
+ this . _off ( this . document , "mousemove" ) ;
256
264
257
265
this . closing = true ;
258
266
this . _trigger ( "close" , event , { tooltip : tooltip } ) ;
You can’t perform that action at this time.
0 commit comments