If I drive my masonry-brick elements with an ngFor call against an array, when I reload that array with a new item, it always pushes it to the bottom (appends). Note that I'm not pushing something onto the array - it is a new array obtained from a subscription. I have called masonry._msnry.reloadItems, which does nothing, and 'masonry.layoutwhich also does nothing. (I've also tried callingreloadItemsfollowed bylayout` which also does nothing).
If I reload the page, the items render in the correct order.
How do I force masonry to redraw using the new array's order like it does on initial load?
...using setTimeout to call reloadItems and layout to ensure the view has been updated first works. Likely this isn't a bug, just not how I'd prefer it work (but it works fine).
If I drive my
masonry-brick
elements with anngFor
call against an array, when I reload that array with a new item, it always pushes it to the bottom (appends). Note that I'm not pushing something onto the array - it is a new array obtained from a subscription. I have calledmasonry._msnry.reloadItems
, which does nothing, and 'masonry.layoutwhich also does nothing. (I've also tried calling
reloadItemsfollowed by
layout` which also does nothing).If I reload the page, the items render in the correct order.
How do I force masonry to redraw using the new array's order like it does on initial load?