Skip to content

Commit f3db655

Browse files
VitalyVoroshilovjasonaden
authored andcommitted
fix(tooltip): properly gc popupTimeout
- Make sure to cancel timeout before setting to `null` Closes angular-ui#2786
1 parent 4e74ee3 commit f3db655

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tooltip/tooltip.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ angular.module('ui.bootstrap.tooltip', ['ui.bootstrap.position'])
203203

204204
// Show the tooltip popup element.
205205
function show() {
206-
popupTimeout = null;
206+
if (popupTimeout) {
207+
$timeout.cancel(popupTimeout);
208+
popupTimeout = null;
209+
}
207210

208211
// If there is a pending remove transition, we must cancel it, lest the
209212
// tooltip be mysteriously removed.

0 commit comments

Comments
 (0)