Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max number of rows? #30

Closed
eelkeh opened this issue Feb 12, 2015 · 12 comments
Closed

max number of rows? #30

eelkeh opened this issue Feb 12, 2015 · 12 comments
Labels
stale The label to apply when a pull request or an issue is stale

Comments

@eelkeh
Copy link

eelkeh commented Feb 12, 2015

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!

@STRML
Copy link
Collaborator

STRML commented Mar 8, 2015

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

@ghost
Copy link

ghost commented Apr 29, 2015

+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.)

@ngotchac
Copy link

That would be great! :)

@STRML
Copy link
Collaborator

STRML commented May 3, 2016

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.

@jlndk
Copy link

jlndk commented Jun 10, 2016

+1

@STRML
Copy link
Collaborator

STRML commented Jul 11, 2016

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

@antoine35
Copy link

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

@SomethingSexy
Copy link

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.

@github-actions
Copy link

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

@github-actions github-actions bot added the stale The label to apply when a pull request or an issue is stale label Oct 13, 2019
@ryancwalsh
Copy link

Thank you so much for this amazing library. I'm very impressed.

I would definitely love if we had maxRows and maxCols props that worked well. (E.g. I'd like to have a 3x3 grid of tiles that can be dragged around only within that 3x3 grid.)

From the comments on this issue and the linked one, it seems like the callbacks that would be necessary in order to implement maxRows and maxCols props don't exist either.

As I start to use react-grid-layout, I will explore, and I'll let you know if I come up with anything.

@adnan-smlatic
Copy link

Any news on this in 2024? I'm facing the same issue, trying to make a 2x3 grid of tiles that can only be moved within the grid, but it ended up being such a headache.

@ryancwalsh did you figure it out?

@ryancwalsh
Copy link

@adnan-smlatic Nope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale The label to apply when a pull request or an issue is stale
Projects
None yet
Development

No branches or pull requests

8 participants