wadackel / react-stack-grid

Pinterest like layout components for React.js
https://wadackel.github.io/react-stack-grid/
MIT License
870 stars 77 forks source link

How I fixed overlapping! #72

Closed jrnxf closed 2 years ago

jrnxf commented 3 years ago

There's not a discussion section for this library so I'm having to create an issue (feel free to let me know if there's a better way to do this), but I wanted to share my fix for dealing with overlapping items! For background, I would see overlapping every time I viewed my grid on mobile, and then sometimes at certain breakpoints I would get unlucky and see some stacking. To resolve this, I implemented the following custom component.

https://gist.github.com/coloradocolby/4d29d94ff1c2a0612f3a4edc684c26fb

I really hope this helps someone! 🚀

aaronncfca commented 3 years ago

Thanks! I found this resolved the same issue for me, although it is a bit of a hack; I'd love to see a fix that works to ensure more accurate height calculation within the component itself.