Before you submit a feature request or report a bug to be fixed, make sure you have stared this repository. A donation is also welcomed
Describe the bug
It would be great if goToSlide had an optional argument that could cause the carousel to bypass/ignore the animation. For example, if you wanted to instantaneously skip to a slide on rerender.
To Reproduce
Steps to reproduce the behavior (there are definitely other ways to see this but this is how I found it):
Create a carousel with some items (mine had 5 items total, 1 visible at a time)
Create a ref to the carousel and manage it in a parent component
From the parent component, using a useEffect to determine whenever the ref updates, use carouselRef?.goToSlide(someNumber)
See how it animates - I want this to be instantaneous
Expected behavior
I wanted the transition to the target slide to be instantaneous. Note: I cannot just change transitionDuration to 0 because I want the animations when the arrows are clicked to work regularly.
Screenshots
N/A
Additional context
I believe the issue could be fixed with an optional parameter in the goToSlide function, perhaps skipAnimation?: boolean and then this.animationAllowed will only become true if this is false or undefined. This is only a couple lines of code!
Prerequisite
Before you submit a feature request or report a bug to be fixed, make sure you have stared this repository. A donation is also welcomed
Describe the bug It would be great if
goToSlide
had an optional argument that could cause the carousel to bypass/ignore the animation. For example, if you wanted to instantaneously skip to a slide on rerender.To Reproduce Steps to reproduce the behavior (there are definitely other ways to see this but this is how I found it):
useEffect
to determine whenever the ref updates, usecarouselRef?.goToSlide(someNumber)
Expected behavior I wanted the transition to the target slide to be instantaneous. Note: I cannot just change
transitionDuration
to 0 because I want the animations when the arrows are clicked to work regularly.Screenshots N/A
Additional context I believe the issue could be fixed with an optional parameter in the
goToSlide
function, perhapsskipAnimation?: boolean
and thenthis.animationAllowed
will only becometrue
if this isfalse
orundefined
. This is only a couple lines of code!Reproduction N/A