File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,13 @@ $.widget( "ui.tooltip", {
81
81
return ;
82
82
}
83
83
84
- target . attr ( "title" , "" ) ;
84
+ // if we have a title, clear it to prevent the native tooltip
85
+ // we have to check first to avoid defining a title if none exists
86
+ // (we don't want to cause an element to start matching [title])
87
+ // TODO: document why we don't use .removeAttr()
88
+ if ( target . is ( "[title]" ) ) {
89
+ target . attr ( "title" , "" ) ;
90
+ }
85
91
86
92
// TODO: why is this check after we clear the title?
87
93
if ( this . options . disabled ) {
@@ -120,7 +126,10 @@ $.widget( "ui.tooltip", {
120
126
target = $ ( event ? event . currentTarget : this . element ) ,
121
127
tooltip = this . _find ( target ) ;
122
128
123
- target . attr ( "title" , target . data ( "tooltip-title" ) ) ;
129
+ // only set title if we had one before (see comment in _open())
130
+ if ( target . data ( "tooltip-title" ) ) {
131
+ target . attr ( "title" , target . data ( "tooltip-title" ) ) ;
132
+ }
124
133
125
134
if ( this . options . disabled ) {
126
135
return ;
You can’t perform that action at this time.
0 commit comments