codyhouse / cd-filter-changelog

Report issues and get notified about changes affecting the 'Filter' component.
https://codyhouse.co/ds/components/app/filter
0 stars 0 forks source link

Masonry gallery? #2

Open alexandrebuffet opened 3 years ago

alexandrebuffet commented 3 years ago

Hi there,

Is there a way to make filter component work with masonry component gallery?

I basically tried to create a higher level component with filter and masonry as dependencies then init filter and dispatch masonry-resize event, but it went wrong.

Thanks!

claudia-romano commented 3 years ago

Hi Alexander, could you try dispatching the masonry-reset event? Each time you use the filter component, you change the images that are visible, so you would need to reset all the gallery.

alexandrebuffet commented 3 years ago

Hi, thanks for your help!

I tried dispatching the masonry-reset event as you mention and it works, but now transition looks weird.

I init Filter first then Masonry and Filter calculation seems interfering with Masonry one. I'm not sure to understand what's going on. Is there anything else to do?

Here in action:

https://user-images.githubusercontent.com/43843473/136086921-8714b7b8-9576-4037-96bc-a57d32e6d57d.mp4