Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

ion-slide slideWillChange has already incremented the activeIndex #394

Open
ionitron-bot bot opened this issue Nov 29, 2018 · 0 comments
Open

ion-slide slideWillChange has already incremented the activeIndex #394

ionitron-bot bot opened this issue Nov 29, 2018 · 0 comments
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 29, 2018

Original issue by @johanlantz on 2018-08-02T07:24:38Z

Bug Report

Ionic Info

cli packages: (/Users/yc00025/.nvm/versions/node/v8.7.0/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

local packages:

    @ionic/app-scripts : 3.1.11
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v8.7.0
    npm  : 5.4.2
    OS   : macOS High Sierra

Misc:

    backend : pro

Describe the Bug
I have an ion-slides setup like this:

<ion-slides (ionSlideDidChange)="slideChanged()" (ionSlideWillChange)="slideWillChange()">

slideWillChange() {
   console.log(this.slides.getActiveIndex());
}

slideChanged($event) {
  console.log(this.slides.getActiveIndex());
}

Current Behavior
Both functions output the same activeIndex, i.e. the one we have already moved to.

Expected Behavior
imho, I would expect the slideWillChange() function to have activeIndex as the slide where we are before the transition and the slideChanged() function to output the activeIndex of the new slide once the transition is completed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants