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

Grid Layout requires scroll to update #14

Open
quizzicalIntern opened this issue Jun 2, 2017 · 5 comments
Open

Grid Layout requires scroll to update #14

quizzicalIntern opened this issue Jun 2, 2017 · 5 comments
Labels

Comments

@quizzicalIntern
Copy link

Hello,

I am working with the react-stack-grid, and when the page loads, all of the cards in the grid are minimized within the grid until the user scrolls. Is there a method to force these to be full-sized upon first going to the page?
screen shot 2017-06-02 at 1 07 33 pm

@wadackel
Copy link
Owner

wadackel commented Jun 4, 2017

Hi @quizzicalIntern. Thanks for Issues 😃
Is this behavior when monitorImagesLoaded is set to true?

If you want to render first at the original size, you need to set the size of the item in the grid.
I think that it is necessary to keep the size of the image separately from the URL of the image.

The following example may be helpful.

1. px Base

<div
  style={{
    width: 200,
    height: 400,
  }}
>
  ...
</div>

2. Responsive

<div
  style={{
    width: '100%',
    height: 0,
    paddingBottom: '200%',  // => (height / width) * 100
  }}
>
  ...
</div>

@quizzicalIntern
Copy link
Author

quizzicalIntern commented Jun 5, 2017 via email

@wadackel
Copy link
Owner

wadackel commented Jun 6, 2017

Hi, Thanks for response.

StackGrid may have a bug around the size of the item ....
The code you tell me does not seem to be a problem.

It is helpful if you can tell me the smallest code that can reproduce Issue, if possible.

@quizzicalIntern
Copy link
Author

quizzicalIntern commented Jun 9, 2017 via email

@BeatDeer
Copy link

Hello I use gutterHeight:

<StackGrid columnWidth={520} gutterHeight={70} duration={0} > {catalogs} </StackGrid>

and fix this problem.

I hope it's useful. 😄 🤝

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

No branches or pull requests

3 participants