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

ion-slides with loop not looping #5816

Closed
gergol opened this issue Mar 11, 2016 · 7 comments
Closed

ion-slides with loop not looping #5816

gergol opened this issue Mar 11, 2016 · 7 comments

Comments

@gergol
Copy link

gergol commented Mar 11, 2016

Short description of the problem:

I can't get ion-slides to loop, neither from the first slide back to the last, nor from the last to the first. There is no difference between <ion-slides loop="true"> and <ion-slides loop="false">. Tried with and without pager and/or autoplay.

The same code worked as expected in Ionic Version: 2.0.0-alpha.57, but not in beta.1 (not 100% sure). It is definitely broken since 2.0.0-beta.2.

What behavior are you expecting?

I would expect the first slide show again after pulling the last slide to the left. And the last slide should show after pulling the first slide to the right.

Steps to reproduce:

  1. Start a blank starter app with --v2
  2. Copy and paste the ion-slides example code from the docs into the <ion-content> of the home.html.
  3. Try to slide beyond slide 3.

This is the content of my home.html:

<ion-navbar *navbar>
  <ion-title>
    Home
  </ion-title>
</ion-navbar>

<ion-content class="home">
  <ion-slides pager loop="true" autoplay="false">

    <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>
    </ion-slide>

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

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Which Ionic Version? 1.x or 2.x
2.x

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 6.0.0
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS
Node Version: v4.4.0

@brandyscarney
Copy link
Member

The loop attribute was removed in favor of using options. Please take a look at this example:

https://github.com/driftyco/ionic/blob/2.0/ionic/components/slides/test/loop/main.html#L2
https://github.com/driftyco/ionic/blob/2.0/ionic/components/slides/test/loop/index.ts#L27-L30

There is an issue to improve slides here #5508 so please add any feedback you have there. Thanks! 😄

@mohammadshamma
Copy link

The links above are broken. I would appreciate if you can provide working links.

@AlainMus
Copy link

AlainMus commented Mar 6, 2017

I am in need of the same thing :) i want the first slide after the last and the last when pulling the first slide to the right.
At the moment i can only go from the last slide to the first
image
When adding this it works from the last to the first, however i can not slide the other way.
Dont forget to import Slides.
image
And reference them
image

And it actually goes to the second instead of the first slide

@destinf
Copy link

destinf commented Apr 26, 2017

And it actually goes to the second instead of the first slide

Not sure if this helps, but I ran into this symptom, it occurred when I added the slides in ionViewDidEnter(). When I moved the same functionality to the constructor it worked as expected, looped last to first

@prabodh25
Copy link

Even I am facing the same issue. I have added ion card inside ion slide and kept loop =true. It goes to second slide after last. Anyone found any resolution on this yet?

@AugusDogus
Copy link

@brandyscarney Can you please post updated links or a different answer if the solution has changed?

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 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

8 participants