mirror of
https://github.com/jquery/jquery-ui.git
synced 2026-04-20 03:02:41 -04:00
Tooltip: Check type on event directly, preventing TypeError when programmatically moving focus to track-toolipped-input. Fixes #8747 - Tooltip: Using the track option within dialogs creates JS errors
This commit is contained in:
@@ -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 ) );
|
||||
|
||||
2
ui/jquery.ui.tooltip.js
vendored
2
ui/jquery.ui.tooltip.js
vendored
@@ -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
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user