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 rendering with only one item in the first column #104

Open
maplethorpej opened this issue Jan 26, 2022 · 2 comments
Open

Grid rendering with only one item in the first column #104

maplethorpej opened this issue Jan 26, 2022 · 2 comments

Comments

@maplethorpej
Copy link

Describe the bug
The grid intermittently renders with only one item in the first column.

<Masonry
 items={trip.images}
 render={Photo}
 columnGutter={8}
 columnCount={3}
 columnWidth={230}
/>

Expected behavior
I would expect that, as the images load in, the grid shuffles items into the correct spots.

Screenshots
Screen Shot 2022-01-25 at 8 12 26 PM

Desktop (please complete the following information):

  • OS: macOS
  • Browser: Chrome
  • Version: 97.0.4692.99

Additional context
Navigating away from the page and then back fixes the issue, so I'm assuming this has to do with calculating images as they load.

@mikechabot
Copy link

I'm just familiarizing myself with this library, but a minimal reproducible example is helpful in these types of cases. Is this window scroll, fixed div scroll? How are your outer containers styled?

@jaredLunde
Copy link
Owner

jaredLunde commented Mar 7, 2022

My guess is you're lazily loading these images and you need to use itemHeightEstimate prop for more accurate first-pass renders. Shuffling around after the fact would be astronomically bad for performance.

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