From a83714db4746abf1a57012dd5a5725ec7f2a07e4 Mon Sep 17 00:00:00 2001 From: Nick Zayatz Date: Fri, 25 Sep 2020 15:50:33 -0400 Subject: [PATCH 1/2] Added check for mouseDownTimeout existence before attempting to clear it --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index c29bffed..660201c5 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -250,7 +250,7 @@ export function generateTrigger( componentWillUnmount() { this.clearDelayTimer(); this.clearOutsideHandler(); - clearTimeout(this.mouseDownTimeout); + if (this.mouseDownTimeout) clearTimeout(this.mouseDownTimeout); } onMouseEnter = e => { From 67c7afc81cee1b6dbdc1b9909a19e98724cf71d3 Mon Sep 17 00:00:00 2001 From: Nick Zayatz Date: Fri, 25 Sep 2020 15:51:49 -0400 Subject: [PATCH 2/2] Added explicit null check --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 660201c5..1ec76ccd 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -250,7 +250,7 @@ export function generateTrigger( componentWillUnmount() { this.clearDelayTimer(); this.clearOutsideHandler(); - if (this.mouseDownTimeout) clearTimeout(this.mouseDownTimeout); + if (this.mouseDownTimeout != null) clearTimeout(this.mouseDownTimeout); } onMouseEnter = e => {