eiriklv / react-masonry-component

A React.js component for using @desandro's Masonry
MIT License
1.45k stars 145 forks source link

Additional items added don't always trigger align #88

Open Ganasist opened 7 years ago

Ganasist commented 7 years ago

Hi I'm not sure if this is similar to previous issues but when I append additional items to the original Masonry list, they don't always get aligned nicely, but rather they stack underneath.

In my case, scrolling down (to trigger loading additional items) seems to force correct alignment.

Attached is an image showing what I mean, also a screencap of the DOM showing that there are items that don't seem to get updated at all. Not sure why this happens, if there's a race condition or something else.

Any advice would be much appreciated!!

screen shot 2017-08-01 at 13 46 59

screen shot 2017-08-01 at 13 47 17
afram commented 7 years ago

Hi @Ganasist

Could you please post a stripped down example of the problem on webpackbin?

That would make it easier to help you :-)

droplab commented 3 years ago

hi there, I'm having the exact same issue. I've tried firing masonry.layout() and masonry.reloadItems() after the new items have been appended to the DOM. The newly appended group of elements do not get positioned. NOTE: I'm running react/next.js

Any thoughts are appreciated!