Sync the item in layout when switch layout view mode


I had made a swtichable layout (grid or list) in ionic.

As you can see in the codepen, user can choose the layout to show items (~100 in the case).
But there are some problem about sync.
As you can see in the attachment image, when the user scroll to about the 56th item in the list layout,
the item is still about 42th in the grid layout.
This is caused by the height differences.
Could someone give me some trick about how to sync roughly when user switch? Thanks.