Skip to content
Permalink
Browse files

Tooltip: Avoid errors on mouseover of tooltips with parents that have…

… no title attribute. Fixes #8955 - Tooltip: error when parent element has no title attribute using jQuery <1.7

This corrects a failing test with core 1.6, so no new test is required.
  • Loading branch information...
mikesherov committed Jan 11, 2013
1 parent 83cbf97 commit e4a786e1a4fdd85b391711688bcb9790f38b5352
Showing with 3 additions and 1 deletion.
  1. +3 −1 ui/jquery.ui.tooltip.js
@@ -46,7 +46,9 @@ $.widget( "ui.tooltip", {
version: "@VERSION",
options: {
content: function() {
var title = $( this ).attr( "title" );
// support: IE<9, Opera in jQuery <1.7
// .text() can't accept undefined, so coerce to a string
var title = $( this ).attr( "title" ) || "";
// Escape title, since we're going from an attribute to raw HTML
return $( "<a>" ).text( title ).html();
},

1 comment on commit e4a786e

@Limos

This comment has been minimized.

Copy link

Limos commented on e4a786e Feb 5, 2013

The use of .text() has broken the ability to include HTML markup within tooltips. Angle brackets are converted to their html equivalents so tooltips look like raw html. (Or is the subsequent call to html() supposed to convert back to HTML? I'm using jQuery 1.9.1.)

For now I'm simply using: return title;

Comments? Suggestions?

Please sign in to comment.
You can’t perform that action at this time.