metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.52k stars 605 forks source link

Flickity wont initialize properly in details when open #1214

Closed malkum closed 1 year ago

malkum commented 2 years ago

Hi, When the slider is used in details element as shown in the below case, the vieweport height is not set. I am trying to avoid bootstrap or other js based accordions and want to use details tag for collapsed content. Test case: https://codepen.io/malkum/pen/MWrXKZw

i tried this solution but I think it works for bootstrap accordions and not for details collapsed content. https://codepen.io/desandro/pen/82f5a8d70e47a1f1fbf9922b11bb2be2

malkum commented 2 years ago

UPDATE: Did a fix not sure if it is the right method. The fix is to by default make the details tag open. And after flickity initialization in js collapse and close the details. https://codepen.io/malkum/pen/MWrXKZw

desandro commented 1 year ago

Thanks for reporting back on your solution!