re-resizable
Advanced tools
Comparing version 6.9.11 to 6.9.12
@@ -682,2 +682,4 @@ 'use strict'; | ||
newHeight = newSize.newHeight; | ||
var widthChangedWithGrid = false; | ||
var heightChangedWithGrid = false; | ||
if (this.props.grid) { | ||
@@ -687,4 +689,6 @@ var newGridWidth = snap(newWidth, this.props.grid[0]); | ||
var gap = this.props.snapGap || 0; | ||
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth; | ||
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight; | ||
widthChangedWithGrid = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap; | ||
heightChangedWithGrid = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap; | ||
newWidth = widthChangedWithGrid ? newGridWidth : newWidth; | ||
newHeight = heightChangedWithGrid ? newGridHeight : newHeight; | ||
} | ||
@@ -738,3 +742,9 @@ var delta = { | ||
if (this.props.onResize) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
if (!this.props.grid) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
// fix #783 | ||
} | ||
else if (widthChangedWithGrid || heightChangedWithGrid) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
} | ||
} | ||
@@ -741,0 +751,0 @@ }; |
@@ -615,2 +615,4 @@ var __extends = (this && this.__extends) || (function () { | ||
newHeight = newSize.newHeight; | ||
var widthChangedWithGrid = false; | ||
var heightChangedWithGrid = false; | ||
if (this.props.grid) { | ||
@@ -620,4 +622,6 @@ var newGridWidth = snap(newWidth, this.props.grid[0]); | ||
var gap = this.props.snapGap || 0; | ||
newWidth = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap ? newGridWidth : newWidth; | ||
newHeight = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap ? newGridHeight : newHeight; | ||
widthChangedWithGrid = gap === 0 || Math.abs(newGridWidth - newWidth) <= gap; | ||
heightChangedWithGrid = gap === 0 || Math.abs(newGridHeight - newHeight) <= gap; | ||
newWidth = widthChangedWithGrid ? newGridWidth : newWidth; | ||
newHeight = heightChangedWithGrid ? newGridHeight : newHeight; | ||
} | ||
@@ -671,3 +675,9 @@ var delta = { | ||
if (this.props.onResize) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
if (!this.props.grid) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
// fix #783 | ||
} | ||
else if (widthChangedWithGrid || heightChangedWithGrid) { | ||
this.props.onResize(event, direction, this.resizable, delta); | ||
} | ||
} | ||
@@ -674,0 +684,0 @@ }; |
{ | ||
"name": "re-resizable", | ||
"version": "6.9.11", | ||
"version": "6.9.12", | ||
"description": "Resizable component for React.", | ||
@@ -5,0 +5,0 @@ "title": "re-resizable", |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
153309
2891
0