Skip to content

Commit ed88287

Browse files
committed
2.0.1
1 parent 34aabd4 commit ed88287

File tree

5 files changed

+27
-21
lines changed

5 files changed

+27
-21
lines changed

dist/react-tooltip.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ var ReactTooltip = function (_Component) {
104104
isCapture: props.isCapture || false
105105
};
106106
_this.delayShowLoop = null;
107+
_this.delayHideLoop = null;
107108
return _this;
108109
}
109110

@@ -153,6 +154,7 @@ var ReactTooltip = function (_Component) {
153154
key: 'componentWillUnmount',
154155
value: function componentWillUnmount() {
155156
clearTimeout(this.delayShowLoop);
157+
clearTimeout(this.delayHideLoop);
156158
this.unbindListener();
157159
this.removeScrollListener();
158160
this.mount = false;
@@ -338,14 +340,14 @@ var ReactTooltip = function (_Component) {
338340
this.setState({
339341
placeholder: tooltipText,
340342
multilineCount: multilineCount,
341-
place: e.currentTarget.getAttribute('data-place') ? e.currentTarget.getAttribute('data-place') : this.props.place ? this.props.place : 'top',
342-
type: e.currentTarget.getAttribute('data-type') ? e.currentTarget.getAttribute('data-type') : this.props.type ? this.props.type : 'dark',
343-
effect: e.currentTarget.getAttribute('data-effect') ? e.currentTarget.getAttribute('data-effect') : this.props.effect ? this.props.effect : 'float',
344-
offset: e.currentTarget.getAttribute('data-offset') ? e.currentTarget.getAttribute('data-offset') : this.props.offset ? this.props.offset : {},
345-
html: e.currentTarget.getAttribute('data-html') ? e.currentTarget.getAttribute('data-html') : this.props.html ? this.props.html : false,
346-
delayShow: e.currentTarget.getAttribute('data-delay-show') ? e.currentTarget.getAttribute('data-delay-show') : this.props.delayShow ? this.props.delayShow : 0,
347-
delayHide: e.currentTarget.getAttribute('data-delay-hide') ? e.currentTarget.getAttribute('data-delay-hide') : this.props.delayHide ? this.props.delayHide : 0,
348-
border: e.currentTarget.getAttribute('data-border') ? e.currentTarget.getAttribute('data-border') === 'true' : this.props.border ? this.props.border : false,
343+
place: e.currentTarget.getAttribute('data-place') || this.props.place || 'top',
344+
type: e.currentTarget.getAttribute('data-type') || this.props.type || 'dark',
345+
effect: e.currentTarget.getAttribute('data-effect') || this.props.effect || 'float',
346+
offset: e.currentTarget.getAttribute('data-offset') || this.props.offset || {},
347+
html: e.currentTarget.getAttribute('data-html') || this.props.html || false,
348+
delayShow: e.currentTarget.getAttribute('data-delay-show') || this.props.delayShow || 0,
349+
delayHide: e.currentTarget.getAttribute('data-delay-hide') || this.props.delayHide || 0,
350+
border: e.currentTarget.getAttribute('data-border') === 'true' || this.props.border || false,
349351
extraClass: extraClass,
350352
multiline: multiline
351353
});
@@ -407,7 +409,8 @@ var ReactTooltip = function (_Component) {
407409
var delayHide = this.state.delayHide;
408410

409411
clearTimeout(this.delayShowLoop);
410-
setTimeout(function () {
412+
clearTimeout(this.delayHideLoop);
413+
this.delayHideLoop = setTimeout(function () {
411414
_this4.setState({
412415
show: false
413416
});

0 commit comments

Comments
 (0)