svelte-infinite-loading icon indicating copy to clipboard operation
svelte-infinite-loading copied to clipboard

Masonry - Is there a hook or callback I can use to re-fire masonry when new elements loaded?

Open nimmolo opened this issue 3 years ago • 1 comments

Hi Skayo, thanks for this library! :) I'm trying svelte-infinite-loading and tiny-virtual-list out, on a grid of Bootstrap column elements (flex columns, not CSS Grid, because i need to support more browsers).

I'd like to apply masonryjs to the elements and re-fire it when new elements are loaded. It seems like virtual list might provide an event to listen to, but I don't find it.

Or should I fire it on my own fetchMore for next page of data? It seems like there might be timing issues with that.

nimmolo avatar Nov 11 '21 22:11 nimmolo

I'd re-fire it in your fetchData method, as you've said, but only after the tick() promise resolves. This way there won't be any timing issues.

More on tick()

Let me know if it worked!

jonasgeiler avatar Nov 12 '21 11:11 jonasgeiler

Closing this due to inactivity. Let me know if you need any more help!

jonasgeiler avatar Feb 12 '24 12:02 jonasgeiler

Thanks Jonas... I put that project on hold, sorry I didn't get back to you!

nimmolo avatar Feb 12 '24 20:02 nimmolo