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() } }