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", {
118118 target = $ ( event ? event . target : this . element )
119119 . closest ( this . options . items ) ;
120120
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 ) ) ;
123133 return ;
124134 }
125135
@@ -250,9 +260,7 @@ $.widget( "ui.tooltip", {
250260
251261 target . removeData ( "tooltip-open" ) ;
252262 this . _off ( target , "mouseleave focusout keyup" ) ;
253-
254- // TODO use _off
255- this . document . unbind ( "mousemove.tooltip" ) ;
263+ this . _off ( this . document , "mousemove" ) ;
256264
257265 this . closing = true ;
258266 this . _trigger ( "close" , event , { tooltip : tooltip } ) ;
You can’t perform that action at this time.
0 commit comments