Giter VIP home page Giter VIP logo

Comments (5)

eiriklv avatar eiriklv commented on July 20, 2024

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"?

from react-masonry-component.

afram avatar afram commented on July 20, 2024

@cybercomkvint can you please try the 3.0.0 beta and see if it fixes things for you?

npm install --save [email protected]

You no longer need to pass in React to a function - also a little extra setup required if using Webpack. More info in Readme

from react-masonry-component.

terencechow avatar terencechow commented on July 20, 2024

I had the same problem and can confirm using 3.0.0-rc.1 does not fix it. However using a dummy element does fix it. Quite odd..

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.

from react-masonry-component.

wkw avatar wkw commented on July 20, 2024

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 div as first element of every filtered view solved the problem.

from react-masonry-component.

jarindr avatar jarindr commented on July 20, 2024

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.

from react-masonry-component.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.