Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: pager not updating on navigation #5745

Closed
dylanvdmerwe opened this issue Mar 7, 2016 · 4 comments
Closed

bug: pager not updating on navigation #5745

dylanvdmerwe opened this issue Mar 7, 2016 · 4 comments
Assignees
Milestone

Comments

@dylanvdmerwe
Copy link
Contributor

Short description of the problem:

After a new page has been pushed onto the navController, when navigating back to the ion-slides page, the pager is stuck on page 1.

What behavior are you expecting?

The pager gets stuck on index 1 and does not change when moving through the ion-slide views.

Steps to reproduce:

  1. Create an ion-slides page with a few ion-slide views inside. The last ion-slide to have a button that pushes a new page onto the NavController.
  2. Press the button to push a new page onto the NavController.
  3. Press the navbar back button to return back to the ion-slides page.
  4. You should now be on the last ion-slide in the ion-slides component. Pager is now stuck on index 1 and does not update.

Ionic Version: 2.x

Browser & Operating System: iOS / Android / Chrome

Run ionic info from terminal/cmd prompt:

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.2
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
OS:
Node Version: v5.7.0
@jgw96
Copy link
Contributor

jgw96 commented Mar 11, 2016

Thanks for opening an issue with us! I appreciate the detail! Would you mind making a codepen or a repo that we can use to repro this issue please?

@dylanvdmerwe
Copy link
Contributor Author

Navigation:
Page 1 (has slider) -> Page 4 (has slider) -> Page 2 (blank)
Then go back to Page 1 and the slider's pager gets stuck.

Page 1 HTML

<ion-navbar *navbar>
    <ion-title>Tab 1</ion-title>
</ion-navbar>
<ion-content>
    <ion-slides pager loop="true" autoplay="true">

        <ion-slide style="background-color: green">
            <h2>Slide 1</h2>
        </ion-slide>

        <ion-slide style="background-color: blue">
            <h2>Slide 2</h2>
        </ion-slide>

        <ion-slide style="background-color: red">
            <h2>Slide 3</h2>
            <button (click)="push()">Push</button>
        </ion-slide>

    </ion-slides>
</ion-content>

Page 1 TS

import {Page4} from '../page4/page4';

@Page({
  templateUrl: 'build/pages/page1/page1.html',
})
export class Page1 {
    constructor(private nav:NavController){

    }

    push() {
        this.nav.push(Page4);
    }
}

Page 4 HTML is identical to Page 1 above
Page 4 TS is the same as above except it pushes Page2 onto NavController.

Page 2 TS

<ion-navbar *navbar>
  <ion-title>
    Tab 2
  </ion-title>
</ion-navbar>

<ion-content class="page2">

</ion-content>

Result when navigating back to Page 1:
capture

@brandyscarney brandyscarney self-assigned this Apr 2, 2016
@brandyscarney brandyscarney added this to the 2.0.0-beta.5 milestone Apr 2, 2016
@jgw96
Copy link
Contributor

jgw96 commented Apr 12, 2016

Was able to confirm this, here is a repo you can pull and use to repro it: https://github.com/jgw96/Ionic2-Slides-Test

@brandyscarney
Copy link
Member

Thanks for the issue! Should be fixed in the beta.5 release. 😄

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants