aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/unit/tooltip/tooltip_options.js8
-rw-r--r--ui/jquery.ui.tooltip.js2
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js
index 9f0de2b57..f9da27fb7 100644
--- a/tests/unit/tooltip/tooltip_options.js
+++ b/tests/unit/tooltip/tooltip_options.js
@@ -146,4 +146,12 @@ test( "track + show delay", function() {
equal( $( ".ui-tooltip" ).css( "top" ), topVal + offsetVal + "px" );
});
+test( "track and programmatic focus", function() {
+ expect( 1 );
+ $( "#qunit-fixture div input" ).tooltip({
+ track: true
+ }).focus();
+ equal( "inputtitle", $( ".ui-tooltip" ).text() );
+});
+
}( jQuery ) );
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index c05be1d45..325e20efb 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -252,7 +252,7 @@ $.widget( "ui.tooltip", {
}
tooltip.position( positionOption );
}
- if ( this.options.track && event && /^mouse/.test( event.originalEvent.type ) ) {
+ if ( this.options.track && event && /^mouse/.test( event.type ) ) {
this._on( this.document, {
mousemove: position
});