Skip to content

Swiper reference destroyed after moving the Swiper to offscreen area #8052

@bluelemonade

Description

@bluelemonade

I'm having a little trouble understanding the destroyed feature. When is it activated?

I have the following setup: I have a vertical swiper in Vue3. OnMount, the swiper is read into a variable.

swiperRef = document.querySelector('.swiper').swiper;

Occasionally, I swipe the swiper offscreen, after which the swiper is still fully functional, only SwiperRef.slideNext() no longer works. No error, nothing!

The SwiperRef looks like this:
Proxy(Swiper) {destroyed: true}

If I recreate the reference before slideNext, everything is fine. I can do that, of course, I'd just like to understand why that's the case or how I can improve it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions