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

Commit

Permalink
fix(tooltip): race condition when setting position
Browse files Browse the repository at this point in the history
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
  • Loading branch information
RobJacobs authored and wesleycho committed Oct 28, 2015
1 parent 1cfaf64 commit 429ddc1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s

// Hide the tooltip popup element.
function hide() {
cancelShow();
cancelHide();

if (!ttScope) {
return;
}
Expand Down Expand Up @@ -307,9 +304,10 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s
}

function removeTooltip() {
cancelShow();
cancelHide();
unregisterObservers();

transitionTimeout = null;
if (tooltip) {
tooltip.remove();
tooltip = null;
Expand Down Expand Up @@ -501,8 +499,6 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position', 'ui.bootstrap.s

// Make sure tooltip is destroyed and removed.
scope.$on('$destroy', function onDestroyTooltip() {
cancelShow();
cancelHide();
unregisterTriggers();
removeTooltip();
openedTooltips.remove(ttScope);
Expand Down

0 comments on commit 429ddc1

Please sign in to comment.