desandro / masonry

:love_hotel: Cascading grid layout plugin
https://masonry.desandro.com
16.28k stars 2.11k forks source link

Items stacking in wrong order #1137

Closed alexb148 closed 2 years ago

alexb148 commented 4 years ago

Test case: https://codepen.io/alexb148/pen/mdVyEjY

Hard to describe this, but the test case should make it very clear. With my setup, items are very clearly being stacked in the wrong order.

Most items are 33% width, but I have some 50% width items at the top. I am using a spacer item first, to define the correct size.

For some reason, the 50% items are being stacked on top of each other, when there is very clearly room for them to sit side-by-side.

Can anyone see why this isn't working? Or provide a fix? Or know of a workaround?

Thanks

alexb148 commented 2 years ago

Updating so this can be closed. Turns out it was user error. The sizer element was wrong. All columns must be a round multiple of the sizer element.