Change array order breaks masonry template 🤔
See original GitHub issueMy app consist in an array of item that can be ordered by some filter criteria using a MAT MENU to select the preferred criteria
But when I change the order or my items array masonry is rendered completely wrong, for example:
I have tried as documentation says:
Set [ordered]="true"
in template, also use masonry functions to render again when my array is re-ordered
this.masonry.reloadItems();
this.masonry.layout();
This is how it looks ordered at init
Some times the order is applied fine but mostly is rendered wrong
This is my reproduction repo in github https://github.com/AlonsoK28/amazmation-app-2/tree/feature/update-layout because I cant upload it to stackblitz 😢
I hope you can help me 😜👏
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Masonry effect - How can I change the order of the blocks?
You can do this effect using CSS grid .columns { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(10px, ...
Read more >Pushing a new object in the array does not rerender ... - GitHub
When I try to post an API request and get the response and push that object into the array. The masonry will not...
Read more >Masonry layout - CSS: Cascading Style Sheets | MDN
Masonry layout is a layout method where one axis uses a typical strict grid layout, most often columns, and the other a masonry...
Read more >Masonry / portolio grid: How can I change the order of sort ...
I'd like to arrange the sort options (when using masonry or portfolio grid) by my own preferences. At the moment they appear in...
Read more >A Lightweight Masonry Solution - CSS-Tricks
In order to do this, we go to about:config in Firefox and search for “masonry.” This brings up the layout.css.grid-template-masonry-value.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, didn’t realize the order is wrong. Could you try this? Thanks!
Hi, it seems like the
reloaditems
function is causing the problem. Try remove bothreloadItems
andlayout