Skip to content

Commit ba752cf

Browse files
committed
Tooltip: Run _disable when disabled option is set on create. Fixes #8712 - Tooltip: Disabled tooltips on initialization.
1 parent 1fcccd4 commit ba752cf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

tests/unit/tooltip/tooltip_options.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
module( "tooltip: options" );
44

5+
test( "disabled: true", function() {
6+
expect( 1 );
7+
$( "#tooltipped1" ).tooltip({
8+
disabled: true
9+
}).tooltip( "open" );
10+
equal( $( ".ui-tooltip" ).length, 0 );
11+
});
12+
513
test( "content: default", function() {
614
expect( 1 );
715
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );

ui/jquery.ui.tooltip.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ $.widget( "ui.tooltip", {
7575
this.tooltips = {};
7676
// IDs of parent tooltips where we removed the title attribute
7777
this.parents = {};
78+
79+
if ( this.options.disabled ) {
80+
this._disable();
81+
}
7882
},
7983

8084
_setOption: function( key, value ) {

0 commit comments

Comments
 (0)