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

rc-align

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-align - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

48

lib/Align.js

@@ -63,3 +63,3 @@ 'use strict';

if (!props.disabled) {
setTimeout(function () {
this.hackRefTimer = setTimeout(function () {
(0, _domAlign2['default'])(_react2['default'].findDOMNode(_this), props.target(), props.align);

@@ -73,2 +73,7 @@ }, 0);

}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps() {
this.clearHackRefTimer();
}
}, {
key: 'startMonitorWindowResize',

@@ -89,2 +94,10 @@ value: function startMonitorWindowResize() {

}, {
key: 'clearHackRefTimer',
value: function clearHackRefTimer() {
if (this.hackRefTimer) {
clearTimeout(this.hackRefTimer);
this.hackRefTimer = null;
}
}
}, {
key: 'handleWindowResize',

@@ -101,2 +114,3 @@ value: function handleWindowResize() {

this.stopMonitorWindowResize();
this.clearHackRefTimer();
}

@@ -106,2 +120,4 @@ }, {

value: function componentDidUpdate(prevProps) {
var _this2 = this;
var reAlign = false;

@@ -111,20 +127,22 @@ var props = this.props;

if (!props.disabled) {
if (prevProps.disabled || prevProps.align !== props.align) {
reAlign = true;
currentTarget = props.target();
} else {
var lastTarget = prevProps.target();
currentTarget = props.target();
if (isWindow(lastTarget) && isWindow(currentTarget)) {
reAlign = false;
} else if (lastTarget !== currentTarget) {
this.hackRefTimer = setTimeout(function () {
if (!props.disabled) {
if (prevProps.disabled || prevProps.align !== props.align) {
reAlign = true;
currentTarget = props.target();
} else {
var lastTarget = prevProps.target();
currentTarget = props.target();
if (isWindow(lastTarget) && isWindow(currentTarget)) {
reAlign = false;
} else if (lastTarget !== currentTarget) {
reAlign = true;
}
}
}
}
if (reAlign) {
(0, _domAlign2['default'])(_react2['default'].findDOMNode(this), currentTarget, props.align);
}
if (reAlign) {
(0, _domAlign2['default'])(_react2['default'].findDOMNode(_this2), currentTarget, props.align);
}
}, 0);

@@ -131,0 +149,0 @@ if (props.monitorWindowResize && !props.disabled) {

{
"name": "rc-align",
"version": "1.1.0",
"version": "1.1.1",
"description": "align 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