Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-tooltip

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-tooltip - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

8

lib/Popup.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc