React-grid-layout: [Feature Request] - Add Max Height property on ReactGridLayout Container

Created on 27 Jan 2017  路  6Comments  路  Source: STRML/react-grid-layout

Hello I'm using react-grid-layout, and having some trouble on achieving this :

 ==================================
 ||              ||              ||
 ||    xxxxxxx   ||    xxxxxxx   ||
 ||    x     x   ||    x     x   ||
 ||    x  A  x   ||    x  B  x   ||
 ||    x     x   ||    x     x   ||
 ||    xxxxxxx   ||    xxxxxxx   ||
 ||              ||              ||
 ==================================

When I drag A to B, I want switch B's position to A.

what I want to happened:

 ==================================
 ||              ||              ||
 ||    xxxxxxx   ||    xxxxxxx   ||
 ||    x     x   ||    x     x   ||
 ||    x  B  x   ||    x  A  x   ||
 ||    x     x   ||    x     x   ||
 ||    xxxxxxx   ||    xxxxxxx   ||
 ||              ||              ||
 ==================================

what actually happened:

 ==================================
 ||              ||              ||
 ||              ||    xxxxxxx   ||
 ||              ||    x     x   ||
 ||              ||    x  A  x   ||
 ||              ||    x     x   ||
 ||              ||    xxxxxxx   ||
 ||              ||              ||
 ||              ||              ||
 ||              ||    xxxxxxx   ||
 ||              ||    x     x   ||
 ||              ||    x  B  x   ||
 ||              ||    x     x   ||
 ||              ||    xxxxxxx   ||
 ||              ||              ||
 ==================================

I don't want the container to expand more than 1 grid's h.
Is there a way to limit its height?
I think by adding height or maxHeight props will help a lot.
Thankyou

stale

Most helpful comment

it would be great!, if there was a property of the maxHeight or height

All 6 comments

I'm having the same issue. I did try the autoSize property:

// If true, the container height swells and contracts to fit contents
autoSize: ?boolean = true,

and setting it to false does keep the containing element from expanding and collapsing but it doesn鈥檛 prevent the items from infinitely stacking and falling off the screen

it would be great!, if there was a property of the maxHeight or height

I'd also find this extremely useful!

i set autoSize to false but i found it dosn't work like it thought,i just didn't want the container box change when resizing the item.

You can maxRows to config ReactGridLayout

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 7 days

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaksZhukov picture MaksZhukov  路  3Comments

dphaener picture dphaener  路  3Comments

gerahimanshu picture gerahimanshu  路  4Comments

sasha240100 picture sasha240100  路  3Comments

fsalamida picture fsalamida  路  3Comments