Skip to content

Commit bd89a0e

Browse files
authored
Merge b2de5d2 into 55ed22f
2 parents 55ed22f + b2de5d2 commit bd89a0e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export function generateTrigger(
262262
componentWillUnmount() {
263263
this.clearDelayTimer();
264264
this.clearOutsideHandler();
265-
clearTimeout(this.mouseDownTimeout);
265+
this.clearMouseDownTimer();
266266
raf.cancel(this.attachId);
267267
}
268268

@@ -389,6 +389,7 @@ export function generateTrigger(
389389
clearTimeout(this.mouseDownTimeout);
390390
this.mouseDownTimeout = window.setTimeout(() => {
391391
this.hasPopupMouseDown = false;
392+
this.clearMouseDownTimer();
392393
}, 0);
393394

394395
if (this.context) {
@@ -666,6 +667,13 @@ export function generateTrigger(
666667
}
667668
}
668669

670+
clearMouseDownTimer() {
671+
if (this.mouseDownTimeout) {
672+
clearTimeout(this.mouseDownTimeout);
673+
this.mouseDownTimeout = null;
674+
}
675+
}
676+
669677
clearOutsideHandler() {
670678
if (this.clickOutsideHandler) {
671679
this.clickOutsideHandler.remove();

0 commit comments

Comments
 (0)