I am trying to get Masonry to work properly in my app and it is just not working the way I would like it to. Nothing is aligning properly in Masonry (big gaps are being left everywhere).
I load a bunch of divs into a region. There is infinite scrolling, and as I scroll, more content is added to the screen.
This is what I do first (it is done after loading the first 20 results into my viewport). Note that after doing this, Masonry is applied, but nothing is aligned properly (There are large gaps between everything).
@resultsRegion.$el.masonry({itemSelector: ".presentation-safe.grid-item",
columnWidth: '.item',
percentPosition: true})
To add more results once I trigger the infinite scrolling:
@displayCollection.add(results)
if @cardLayout == 'flow'
@resultsRegion.$el.masonry('appended')
All of the content is added properly and Masonry is getting applied, though large gaps still remain between all of my content.
I have also tried @resultsRegion.$el.masonry('reloadItems')
but that messes up all of my styles for everything on the page.