Swiper inside modal

Not sure if this should work, but it allows me to add everything through the App Structure so I assume it should.

If I place a swiper component with static slides inside the body of a modal component, then the swiper stops working, although if i take it out the modal it works perfectly.

Mac OS X BigSur
Node.js
Modal is inside a Partial, which is inside a Page, and the Page is inside a Layout, if that makes any difference.

Make sure to enable the observer option in the swiper options.

1 Like

Aha, thanks Teo, I never knew what that was for, just assumed it took away all interaction and was for the end user to then just observe the swiper, haha, clearly I assumed incorrectly.

This option should be used in all cases when the swiper is loaded hidden, in a zero-height container etc. and then displayed. It observes the parent element height and refreshes the swiper when it changes.

2 Likes