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

Vertical auto-switch unexpected behavior after several seconds #398

Open
devinekadeni opened this issue Jan 11, 2024 · 1 comment
Open

Comments

@devinekadeni
Copy link

devinekadeni commented Jan 11, 2024

Version

initially facing this issue on version 6.6.14
reproducible on codesandbox on version 6.8.5

Reproduce Codesandbox

https://codesandbox.io/p/sandbox/keen-slider-vertical-auto-switch-anomaly-mcw8nt

Issue Description

When working with vertical mode and implementing auto-switch mechanism using setTimeout and slider.next, at first it was working fine, but after a while (in seconds), it becomes unexpected.
I notice that this issue happens when I added spacing property. If I remove it, it will work just fine.

Please look at video below to get more understanding (the unexpected behavior happens on time 0:18 in the video)

Kapture.2024-01-11.at.11.23.48.mp4

This is main usage of the useKeenSlider

useKeenSlider<HTMLDivElement>({
    loop: true,
    slides: {
      origin: "center",
      perView: 1,
      spacing: 10,
    },
    vertical: true,
    created: (slider) => {
      setTimeout(() => {
        slider.next();
      }, 500);
    },
    animationEnded: (slider) => {
      setTimeout(() => {
        slider.next();
      }, 500);
    },
  })
@devinekadeni
Copy link
Author

currently can be solved by passing additional plugin mentioned on this issue.
But I hope this can be fixed internally on the package

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

No branches or pull requests

1 participant