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

[v4-beta.7] swiper.slideNext(0) and swiper.slidePrev(0) ignore speed parameter #15407

Closed
peterpeterparker opened this issue Aug 30, 2018 · 1 comment · Fixed by #15409
Closed
Assignees

Comments

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Aug 30, 2018

Ionic Info
v4-beta.7 / angular

Describe the Bug

swiper.slideNext(0) and swiper.slidePrev(0) has no effect, the speed parameter is ignored respectively the transition between slides will still be animated with the default speed

Related Code

@ViewChild('mySlide') private slides: Slides;

await this.slides.slideNext(0);

Expected Behavior
The speed parameter should not be ignored respectively setting 0 should has for effect to have instant transition between slide

Additional Context
I also noticed that doing so, once a slideNext(0) or slidePrev(0) is called, then the event ionSlideDidChange will not be triggered anymore. I guess it's related

Problem

I think that the route of the problem is that the order of the parameters is wrong

in https://github.com/ionic-team/ionic/blob/771c5173c2fe53b94730684330ddfa6bfbb994bb/core/src/components/slides/slides.tsx we have got

@Method()
 slideNext(speed?: number, runCallbacks?: boolean) {
    this.swiper.slideNext(runCallbacks, speed); //<------- here runCallbacks first
 }

in the swiper doc http://idangero.us/swiper/api/

mySwiper.slideNext(speed, runCallbacks); // <----- here runCallbacks second

** PR **

I provided a PR #15409

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 29, 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 29, 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

Successfully merging a pull request may close this issue.

2 participants