Skip to content

Commit b5cf5b6

Browse files
committed
Tooltip: Ignore disabled checks when closing. Fixes #8758 - Tooltip: Tooltip is shown, but not hidden if element has class=ui-state-disabled.
(cherry picked from commit 498aadf)
1 parent 0ad6d7a commit b5cf5b6

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/unit/tooltip/tooltip_core.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,17 @@ test( "form containing an input with name title", function() {
9494
equal( $( ".ui-tooltip" ).length, 0, "no tooltip for form" );
9595
});
9696

97+
test( "tooltip on .ui-state-disabled element", function() {
98+
expect( 2 );
99+
100+
var container = $( "#contains-tooltipped" ).tooltip(),
101+
element = $( "#contained-tooltipped" ).addClass( "ui-state-disabled" );
102+
103+
element.trigger( "mouseover" );
104+
equal( $( ".ui-tooltip" ).length, 1 );
105+
106+
container.empty();
107+
equal( $( ".ui-tooltip" ).length, 0 );
108+
});
109+
97110
}( jQuery ) );

ui/jquery.ui.tooltip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ $.widget( "ui.tooltip", {
299299
if ( !event || event.type === "focusin" ) {
300300
events.focusout = "close";
301301
}
302-
this._on( target, events );
302+
this._on( true, target, events );
303303
},
304304

305305
close: function( event ) {

0 commit comments

Comments
 (0)