From 7b7e547b7113f0158ec471921a50e7c417c3b391 Mon Sep 17 00:00:00 2001 From: wwayne Date: Tue, 2 Aug 2016 07:50:25 +0800 Subject: [PATCH] Fix for delayShwo #163 --- src/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 67ad1f0a9..c4d99968a 100644 --- a/src/index.js +++ b/src/index.js @@ -258,8 +258,8 @@ class ReactTooltip extends Component { } } + this.clearTimer() if (delayShow) { - clearTimeout(this.delayShowLoop) this.delayShowLoop = setTimeout(updateState, delayTime) } else { updateState() @@ -274,18 +274,18 @@ class ReactTooltip extends Component { if (!this.mount) return - const resetState = (resetPlace) => { + const resetState = () => { this.setState({ show: false }) this.removeScrollListener() } + this.clearTimer() if (delayHide) { - this.clearTimer() this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10)) } else { - resetState(true) + resetState() } }