Socket
Socket
Sign inDemoInstall

react-resizable-box

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-resizable-box - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

17

lib/index.js

@@ -83,2 +83,7 @@ 'use strict';

height: 0
},
// offset is back door for rnd component
offset: {
x: 0,
y: 0
}

@@ -205,4 +210,4 @@ };

if (parent instanceof HTMLElement) {
var boundWidth = parent.offsetWidth + (parent.offsetLeft - this.resizable.offsetLeft);
var boundHeight = parent.offsetHeight + (parent.offsetTop - this.resizable.offsetTop);
var boundWidth = parent.offsetWidth + (parent.offsetLeft - this.resizable.offsetLeft) - this.state.offset.x;
var boundHeight = parent.offsetHeight + (parent.offsetTop - this.resizable.offsetTop) - this.state.offset.y;
maxWidth = maxWidth && maxWidth < boundWidth ? maxWidth : boundWidth;

@@ -213,4 +218,4 @@ maxHeight = maxHeight && maxHeight < boundHeight ? maxHeight : boundHeight;

if (typeof window !== 'undefined') {
var _boundWidth = window.innerWidth - this.resizable.offsetLeft;
var _boundHeight = window.innerHeight - this.resizable.offsetTop;
var _boundWidth = window.innerWidth - this.resizable.offsetLeft - this.state.offset.x;
var _boundHeight = window.innerHeight - this.resizable.offsetTop - this.state.offset.y;
maxWidth = maxWidth && maxWidth < _boundWidth ? maxWidth : _boundWidth;

@@ -220,4 +225,4 @@ maxHeight = maxHeight && maxHeight < _boundHeight ? maxHeight : _boundHeight;

} else if (this.props.bounds && this.props.bounds instanceof HTMLElement) {
var _boundWidth2 = this.props.bounds.offsetWidth + (this.props.bounds.offsetLeft - this.resizable.offsetLeft);
var _boundHeight2 = this.props.bounds.offsetHeight + (this.props.bounds.offsetTop - this.resizable.offsetTop);
var _boundWidth2 = this.props.bounds.offsetWidth + (this.props.bounds.offsetLeft - this.resizable.offsetLeft) - this.state.offset.x;
var _boundHeight2 = this.props.bounds.offsetHeight + (this.props.bounds.offsetTop - this.resizable.offsetTop) - this.state.offset.y;
maxWidth = maxWidth && maxWidth < _boundWidth2 ? maxWidth : _boundWidth2;

@@ -224,0 +229,0 @@ maxHeight = maxHeight && maxHeight < _boundHeight2 ? maxHeight : _boundHeight2;

{
"name": "react-resizable-box",
"version": "2.0.0",
"version": "2.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -218,2 +218,6 @@ # react-resizable-box

#### v2.0.1
- Add offset state for rnd component.
#### v2.0.0

@@ -220,0 +224,0 @@

Sorry, the diff of this file is not supported yet

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