React-grid-layout: max number of rows?

Created on 12 Feb 2015  路  9Comments  路  Source: STRML/react-grid-layout

Is there a way to set a maximum number of rows?
Something like:

{ cols:4, maxRows: 10 }

Is something like this possible? Any pointers would be great!

stale

Most helpful comment

maxRows is implemented, but somewhat buggy. It is possible to push an item beyond the maxRows as the compaction algorithm is not tuned to move elements sideways.

All 9 comments

Sorry, this is not yet possible. You could likely implement it yourself using the onDragStop and onResizeStop handlers.

+1. @STRML I'd be more than happy to implement it myself if you could point out what would need adjusting... I took a look at mixinResizable in lib/GridItem.jsx, but it seems we'd have to restrict more than just the height component of maxConstraints. (Imagine a layout with verticalCompact set to false and the smallest possible GridItem being dragged around.)

That would be great! :)

maxRows is implemented, but somewhat buggy. It is possible to push an item beyond the maxRows as the compaction algorithm is not tuned to move elements sideways.

+1

Please don't spam us with +1 comments. Use the emoji, or, better yet, submit a PR.

Has anyone found a solution to force the maximum number of lines ? Thanks

If props.onDrag or props.onDragStop returned whether it could be dropped help with this situation? I am looking for something similar but trying to figure out I can implement it with the given props now.

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

ierhyna picture ierhyna  路  3Comments

sasha240100 picture sasha240100  路  3Comments

victor-unsw picture victor-unsw  路  3Comments

uc-rpr picture uc-rpr  路  4Comments

moritzschaefer picture moritzschaefer  路  3Comments