ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.94k stars 13.52k forks source link

ion-slides (aka slider, swiper) won't play while not in View #14391

Closed AlGantori closed 5 years ago

AlGantori commented 6 years ago

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [X] 3.x [ ] 4.x

I'm submitting a ... (check one with "x") [X] bug report [ ] feature request

Current behavior: If there is a popup (eg. Alert) ion-slides continue to play, however if we navigate temporarily to a page the slider stops. This is NOT the expected default behavior. ionSlideDidChange event stops firing I have sound attached to this event which will not execute either.

Expected behavior: ionSlideDidChange event should keep firing. When playing other media eg. a movie the expected default behavior is that it continues to play. https://ionicframework.com/docs/api/components/slides/Slides/#output-events

Steps to reproduce: Here is a plunker I put together https://plnkr.co/edit/DPFVFYkW4cZbcYAE0AtI

You can verify that when you use the button "Show Page2" the slider stops navigating (firing ionSlideDidChange stops).

<ion-content padding>

    <ion-slides #mySlides
        dir="rtl"
        (ionSlideDidChange)="ionSlideDidChange()">
        <ion-slide *ngFor="let s of SlidesData ;  let ii=index">

            <div id="AMSContent">
                <img id="AMSImage"
                    [src]="s.Pic">
                <div id="AMStext">{{ii}}</div>
            </div>
        </ion-slide>
        <!-- If we need navigation buttons -->
    </ion-slides>
</ion-content>
    // 20180425
    ionSlideDidChange() {
        console.log("ionSlideDidChange------.------>>realIndex", this.Slides.realIndex)
        setTimeout(() => {
            this.Slides.slideNext();
        }, 2000)
    }
ionitron-bot[bot] commented 5 years ago

This issue has been automatically identified as an Ionic 3 issue. We recently moved Ionic 3 to its own repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

If I've made a mistake, and if this issue is still relevant to Ionic 4, please let the Ionic Framework team know!

Thank you for using Ionic!

ionitron-bot[bot] commented 5 years ago

Issue moved to: https://github.com/ionic-team/ionic-v3/issues/621