Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 429ddc1

Browse files
RobJacobswesleycho
authored andcommitted
fix(tooltip): race condition when setting position
A race condition could occur when there is an open delay that doesn't get cancelled after the transition delay resulting in the position logic getting called. This will then try to set the css of the tooltip after is has been destroyed in the removeTooltip function. Closes #4765 Fixes #4757
1 parent 1cfaf64 commit 429ddc1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: src/tooltip/tooltip.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s
252252

253253
// Hide the tooltip popup element.
254254
function hide() {
255-
cancelShow();
256-
cancelHide();
257-
258255
if (!ttScope) {
259256
return;
260257
}
@@ -307,9 +304,10 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s
307304
}
308305

309306
function removeTooltip() {
307+
cancelShow();
308+
cancelHide();
310309
unregisterObservers();
311310

312-
transitionTimeout = null;
313311
if (tooltip) {
314312
tooltip.remove();
315313
tooltip = null;
@@ -501,8 +499,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s
501499

502500
// Make sure tooltip is destroyed and removed.
503501
scope.$on('$destroy', function onDestroyTooltip() {
504-
cancelShow();
505-
cancelHide();
506502
unregisterTriggers();
507503
removeTooltip();
508504
openedTooltips.remove(ttScope);

0 commit comments

Comments
 (0)