splide icon indicating copy to clipboard operation
splide copied to clipboard

Ensuring that drag does not move slides more than `options.flickMaxPages` allows

Open Kreeg opened this issue 2 years ago • 3 comments

Description

If you drag the slider too fast, it moves more than options.flickMaxPages. For example, there is a problem with caused with this config.

{
  flickMaxPages: 1,
  perMove: 1,
  perPage: 1,
}

https://user-images.githubusercontent.com/1666622/224034941-13c70078-e9c3-4f8a-9c18-0913e8bc2224.mp4

In this video you can see that sometimes slider moves more than 1 page. After some digging I found that this is computeDestinations problem. In fact, it's getPosition that causes this error. If you drag fast, it calculates that you are already at the next slide, but in reality, you are not. So in this case I just added a new additional check that splide does not move more than it should.

Sorry for no related issue. This started as a local critical bug on our website so we can't wait too long. We have already switched to a forked version and have tested it in production mode. But I added more unit-tests to be sure.

Kreeg avatar Mar 09 '23 13:03 Kreeg

Sorry for no related issue.

@Kreeg actually, there is at least one: #1002

simonbrunel avatar Mar 17 '23 10:03 simonbrunel

Would love this to be fixed.

tomikaka22 avatar Mar 26 '23 09:03 tomikaka22

You can switch to our fork for now npm i [email protected]:IT-GRI/splide.git

Kreeg avatar Apr 03 '23 07:04 Kreeg