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

Request to make columns as equal height as possible #64

Open
blueedgetechno opened this issue Sep 17, 2020 · 12 comments
Open

Request to make columns as equal height as possible #64

blueedgetechno opened this issue Sep 17, 2020 · 12 comments
Labels
faq Add to readme

Comments

@blueedgetechno
Copy link

It will work perfectly but if some items of particular columns make the column abruptly longer move the last elements of column to other columns.

@paulcollett
Copy link
Owner

Can you clarify what "column abruptly longer" mean? Maybe with code and a screenshot of the unexpected behaviour is possible

@blueedgetechno
Copy link
Author

view

and it's even more below.

@paulcollett
Copy link
Owner

Thanks for the screen shot, I understand what you're asking now.

I'm aware of this behaviour and it's occurring because we don't actually handle this case, but i'm open to revisiting.

To implement it's slight performance trade off, as we need to calculate all the item heights and adjust the layout again, then again after each image has loaded. So for this plugin, avoiding all these re-layouts was actually the motivation behind making this plugin originally.. to be a fast and performant foremost.

If we were to do this I'd consider implementing it to be an "opt-in" feature to retain performance but support this feature to the smaller set of users who would need it. happy to discuss more

@blueedgetechno
Copy link
Author

yeah, that would be very convenient.

@paulcollett paulcollett added the faq Add to readme label Apr 4, 2021
@jaschaio
Copy link

@paulcollett having the same issue as here and in #73. The problem becomes especially bad if you use this package for something like unsplash.com. The more items you display, the larger the difference between the columns can become until you end up with just a single column that is actually filled till the end.

@ryansrofe
Copy link

this is a great alternative to the traditional masonry library 🙌 However, with such uneven columns, it's visually unusable for anything more than a few items as the page looks broken. Is this opt-in feature in the works by any chance?

Screen Shot 2021-09-07 at 3 29 52 PM

@ian-emsens-shd
Copy link

Considering this is, understandably, intended behaviour we'll likely have to switch to infinite loading of our content but as @jaschaio pointed out, that only delays or potentially magnifies the issue.

Keeping an eye on this for future projects 🙏

@gregzaal
Copy link

gregzaal commented Jun 9, 2022

Does anybody have an alternative library they can recommend to get around this issue? It's bad enough with a few elements like in the screenshot above, but if you have over 100 (not uncommon for an image gallery) it leaves columns comically uneven, several screens of height different.

@wildlifechorus
Copy link

did anyone find a solution for this?

@liaojunhao
Copy link

@mui/lab/Masonry Can it be handled?

@haramishra
Copy link

haramishra commented Mar 21, 2023

react-smart-masonry library works, but not sure about the performance.

@Parth909
Copy link

Does anybody have an alternative library they can recommend to get around this issue? It's bad enough with a few elements like in the screenshot above, but if you have over 100 (not uncommon for an image gallery) it leaves columns comically uneven, several screens of height different.

Absolutely True! I'm removing this library immediately.
This is what I need https://www.npmjs.com/package/react-photo-gallery?activeTab=readme

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

No branches or pull requests

10 participants