diff --git a/dist/react-tooltip.js b/dist/react-tooltip.js index fdcb1347e..d4862aca7 100644 --- a/dist/react-tooltip.js +++ b/dist/react-tooltip.js @@ -155,6 +155,7 @@ var ReactTooltip = (function (_Component) { window.removeEventListener('__react_tooltip_hide_event', this.globalHide); window.removeEventListener('__react_tooltip_rebuild_event', this.globalRebuild); window.removeEventListener('resize', this.onWindowResize); + window.clearTimeout(this.delayShowLoop); }; /* TODO: optimize, bind has been trigger too maany times */ @@ -338,7 +339,7 @@ var ReactTooltip = (function (_Component) { var delayShow = _state.delayShow; var show = _state.show; - clearTimeout(this.delayShowLoop); + window.clearTimeout(this.delayShowLoop); var delayTime = show ? 0 : parseInt(delayShow, 10); var eventTarget = e.currentTarget; @@ -375,7 +376,7 @@ var ReactTooltip = (function (_Component) { var delayHide = this.state.delayHide; - clearTimeout(this.delayShowLoop); + window.clearTimeout(this.delayShowLoop); setTimeout(function () { _this3.setState({ show: false diff --git a/package.json b/package.json index 77d77291e..96d553718 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "classnames": "^1.2.0", - "react-dom": "^0.14.0" + "react-dom": "0.14.*" }, "devDependencies": { "babel": "^5.3.1", diff --git a/src/index.js b/src/index.js index c2bde3de4..c26ffc23a 100644 --- a/src/index.js +++ b/src/index.js @@ -114,6 +114,7 @@ export default class ReactTooltip extends Component { window.removeEventListener('__react_tooltip_hide_event', this.globalHide) window.removeEventListener('__react_tooltip_rebuild_event', this.globalRebuild) window.removeEventListener('resize', this.onWindowResize) + window.clearTimeout(this.delayShowLoop) } /* TODO: optimize, bind has been trigger too maany times */ @@ -278,7 +279,7 @@ export default class ReactTooltip extends Component { */ updateTooltip (e) { const {delayShow, show} = this.state - clearTimeout(this.delayShowLoop) + window.clearTimeout(this.delayShowLoop) const delayTime = show ? 0 : parseInt(delayShow, 10) const eventTarget = e.currentTarget @@ -307,7 +308,7 @@ export default class ReactTooltip extends Component { */ hideTooltip () { const {delayHide} = this.state - clearTimeout(this.delayShowLoop) + window.clearTimeout(this.delayShowLoop) setTimeout(() => { this.setState({ show: false