-
Notifications
You must be signed in to change notification settings - Fork 145
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
Bad position/placement if element is prepended in array #11
Comments
And all id's are unique? Seems like an edge case issue when doing prepending to the masonry.. Might be that the "algorithm" for diffing does not account for this. What happens if you always include a dummy element at the top that is "invisible"? |
@cybercomkvint can you please try the 3.0.0 beta and see if it fixes things for you?
You no longer need to pass in React to a function - also a little extra setup required if using Webpack. More info in Readme |
I had the same problem and can confirm using I am using a div with width 1px and height 0px which surprisingly does the trick. If I use an empty div with no styling, it causes all the masonry elements to be stacked vertically despite having plenty of space to be layed out horizontally. |
Also hit this buglet. Same situation, I have a list of items and the ability to filter the set. When going from a filtered view to the "All Items" view, I end up with stacking, empty space in first row. I spent time trying to "kick" masonry to re-layout in componentDidUpdate (didn't work), then tried calling masonry.layout() in a setTimer(). No work. I next did the horrible thing of making my element array key properties always random. that fixed it, but had unwanted side-effects for certain other modal views. Adding the empty |
Thank god I saw this issue, was trying to figure out what's happening with my layout with filtering involved. Hacked with div height 1 width 1 just the same. |
I have an array with elements that I get from filtering a larger array base on some value. I give the children to the masonry unique keys. This works great when the visible child at position 0 in array remains visible all the time. But when a child gets prepended in the array the child elements start to overlap.
The text was updated successfully, but these errors were encountered: