rc-tooltip
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -30,4 +30,4 @@ 'use strict'; | ||
_createClass(Popup, [{ | ||
key: 'getPopupNode', | ||
value: function getPopupNode() { | ||
key: 'getPopupDomNode', | ||
value: function getPopupDomNode() { | ||
return React.findDOMNode(this.refs.popup); | ||
@@ -41,3 +41,3 @@ } | ||
var targetDomNode = React.findDOMNode(props.wrap).firstChild; | ||
var popupDomNode = this.getPopupNode(); | ||
var popupDomNode = this.getPopupDomNode(); | ||
var placement = props.placement; | ||
@@ -76,3 +76,3 @@ var points; | ||
if (transitionName) { | ||
var domNode = this.getPopupNode(); | ||
var domNode = this.getPopupDomNode(); | ||
if (props.visible && !prevProps.visible) { | ||
@@ -79,0 +79,0 @@ anim(domNode, transitionName + '-enter'); |
@@ -42,2 +42,8 @@ 'use strict'; | ||
_createClass(Tooltip, [{ | ||
key: 'getPopupDomNode', | ||
value: function getPopupDomNode() { | ||
// for test | ||
return this.refs.popup ? this.refs.popup.getPopupDomNode() : this.popupInstance.getPopupDomNode(); | ||
} | ||
}, { | ||
key: 'componentWillReceiveProps', | ||
@@ -68,5 +74,10 @@ value: function componentWillReceiveProps(nextProps) { | ||
var state = this.state; | ||
var ref = {}; | ||
if (!props.renderPopupToBody) { | ||
ref.ref = 'popup'; | ||
} | ||
return React.createElement( | ||
Popup, | ||
{ prefixCls: props.prefixCls, | ||
_extends({ prefixCls: props.prefixCls | ||
}, ref, { | ||
visible: state.visible, | ||
@@ -79,3 +90,3 @@ trigger: props.trigger, | ||
style: props.overlayStyle, | ||
transitionName: props.transitionName }, | ||
transitionName: props.transitionName }), | ||
props.overlay | ||
@@ -126,6 +137,15 @@ ); | ||
if (this.props.renderPopupToBody) { | ||
React.render(this.getPopupElement(), this.getTipContainer()); | ||
this.popupInstance = React.render(this.getPopupElement(), this.getTipContainer()); | ||
} | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
value: function componentWillUnmount() { | ||
if (this.tipContainer) { | ||
React.unmountComponentAtNode(this.tipContainer); | ||
document.body.removeChild(this.tipContainer); | ||
this.tipContainer = null; | ||
} | ||
} | ||
}, { | ||
key: 'render', | ||
@@ -132,0 +152,0 @@ value: function render() { |
{ | ||
"name": "rc-tooltip", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "tooltip ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24946
520