Skip to content

Commit 9cbd4b4

Browse files
committed
Tooltip: Clear the tracking interval on close. Fixes #8920 -Tooltip potential setinterval endless loop.
1 parent 9f841df commit 9cbd4b4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ui/jquery.ui.tooltip.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ $.widget( "ui.tooltip", {
270270
// as the tooltip is visible, position the tooltip using the most recent
271271
// event.
272272
if ( this.options.show && this.options.show.delay ) {
273-
delayedShow = setInterval(function() {
273+
delayedShow = this.delayedShow = setInterval(function() {
274274
if ( tooltip.is( ":visible" ) ) {
275275
position( positionOption.of );
276276
clearInterval( delayedShow );
@@ -312,6 +312,9 @@ $.widget( "ui.tooltip", {
312312
return;
313313
}
314314

315+
// Clear the interval for delayed tracking tooltips
316+
clearInterval( this.delayedShow );
317+
315318
// only set title if we had one before (see comment in _open())
316319
if ( target.data( "ui-tooltip-title" ) ) {
317320
target.attr( "title", target.data( "ui-tooltip-title" ) );

0 commit comments

Comments
 (0)