Closed Swimburger closed 3 years ago
@Swimburger try
masonry.reloadItems();
masonry.layout();
That does layout the items after reload. Can't believe it was this obvious. When I did this in AngularJS a looong time ago, reloadItems was all you needed I think.
Thank you @danylobilokha.
I'm using a framework to render my HTML and I don't have sufficient control to use the append/prepend or appended/prepended functions. So I'm using reloadItems, but it doesn't lay out the items. The grid-items have their style updated with 'position: absolute', but not top/left styling.
Here's the issue replicated in CodePen: https://codepen.io/swimburger/pen/BaKjKPG The test case creates a new grid-item every second and call reloadItems.