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

Stretching #12

Open
ghost opened this issue Sep 30, 2015 · 4 comments
Open

Stretching #12

ghost opened this issue Sep 30, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 30, 2015

It is currently not creating a real grid. If my grid is 2 items per row and i have 5 items, the 5th item is rendered across the entire row rather than in it's own part of the grid. This makes for an annoying effect:

image

@ghost
Copy link
Author

ghost commented Sep 30, 2015

I changed the code with the following to add the prop "cleanGrid={true}"

 if (group.length > 0) {
      if (this.props.cleanGrid == true) {
        while (group.length < itemsPerRow) {
          group.push(null);
        }
      }
      itemsGroups.push(group);
    }

This will just push a null response for the amount of rows defined so that the user can check in the render item for null and return an empty container as needed. Not sure if there is a better way of handling this but it works!

image

@daemonchen
Copy link

@bradynapier nice work, I used your code.

@maluramichael
Copy link
Contributor

+1 This should work by default. Please create a pull request.

@clmntcrl clmntcrl mentioned this issue Apr 28, 2016
@hcf0813
Copy link

hcf0813 commented Apr 29, 2016

@bradynapier Who to add the code? Would you give me the whole sources of index.js! I learn React for the first time,I don't know how to add the prop "cleanGrid={true}".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants