mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-12-07 06:14:24 +00: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:
parent
8b3e570241
commit
98173a3d0e
@ -146,4 +146,12 @@ test( "track + show delay", function() {
|
|||||||
equal( $( ".ui-tooltip" ).css( "top" ), topVal + offsetVal + "px" );
|
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 ) );
|
}( 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 );
|
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, {
|
this._on( this.document, {
|
||||||
mousemove: position
|
mousemove: position
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user