Skip to content

Commit 653673e

Browse files
committed
Tooltip: Fix the accessible properties IE exposes
1 parent a1b9fbf commit 653673e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ui/jquery.ui.tooltip.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,15 @@ $.widget( "ui.tooltip", {
128128
// we have to check first to avoid defining a title if none exists
129129
// (we don't want to cause an element to start matching [title])
130130

131-
// We don't use removeAttr as that causes the native tooltip to show
132-
// up in IE (9 and below, didn't yet test 10). Happens only when removing
133-
// inside the mouseover handler.
131+
// We use removeAttr only for key events, to allow IE to export the correct
132+
// accessible attributes. For mouse events, set to empty string to avoid
133+
// native tooltip showing up (happens only when removing inside mouseover).
134134
if ( target.is( "[title]" ) ) {
135-
target.attr( "title", "" );
135+
if ( event && event.type === "mouseover" ) {
136+
target.attr( "title", "" );
137+
} else {
138+
target.removeAttr( "title" );
139+
}
136140
}
137141

138142
// ajaxy tooltip can update an existing one

0 commit comments

Comments
 (0)