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

react-grid-layout

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-grid-layout - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

examples/3-messy.html

16

lib/GridItem.jsx

@@ -126,2 +126,6 @@ 'use strict';

mixinResizable(child, position) {
var p = this.props;
var colWidth = p.containerWidth / p.cols - p.margin[0];
var maxWidth = (colWidth + p.margin[0]) * (p.cols - p.x) - p.margin[0] * 2;
var rowHeight = p.rowHeight - p.margin[1];
return (

@@ -131,2 +135,4 @@ <Resizable

height={position.height}
minConstraints={[colWidth, rowHeight]}
maxConstraints={[maxWidth, Infinity]}
onResizeStop={this.onResizeHandler('onResizeStop')}

@@ -157,5 +163,3 @@ onResizeStart={this.onResizeHandler('onResizeStart')}

// Cap x at numCols
if (x + me.props.w > me.props.cols) {
x = me.props.cols - me.props.w;
}
x = Math.min(x, me.props.cols - me.props.w);

@@ -183,5 +187,5 @@ me.props[handlerName](me.props.i, x, y);

// Cap w at numCols
if (w + me.props.x > me.props.cols) {
w = me.props.cols - me.props.x;
}
w = Math.min(w, me.props.cols - me.props.x);
// Ensure w is at least 1
w = Math.max(w, 1);

@@ -188,0 +192,0 @@ me.setState({resizing: handlerName === 'onResizeStop' ? null : size});

{
"name": "react-grid-layout",
"version": "0.1.0",
"version": "0.1.1",
"description": "A draggable and resizable grid layout with responsive breakpoints, for React.",

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

@@ -21,4 +21,5 @@ ### React-Grid-Layout

[1. Basic](https://strml.github.io/react-grid-layout/examples/1-basic.html)
[1. No Dragging/Resizing (Layout Only)](https://strml.github.io/react-grid-layout/examples/2-no-dragging.html)
1. [Basic](https://strml.github.io/react-grid-layout/examples/1-basic.html)
1. [No Dragging/Resizing (Layout Only)](https://strml.github.io/react-grid-layout/examples/2-no-dragging.html)
1. [Messy Layout Autocorrect](https://strml.github.io/react-grid-layout/examples/3-messy.html)

@@ -25,0 +26,0 @@ ----

@@ -44,3 +44,2 @@ 'use strict';

onLayoutChange: function(layout) {
console.log(layout);
this.setState({layout: layout});

@@ -47,0 +46,0 @@ },

Sorry, the diff of this file is not supported yet

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