splide icon indicating copy to clipboard operation
splide copied to clipboard

loop with perMove cant loop correctly right side

Open Rados51 opened this issue 2 years ago • 6 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

v4.0.6

Description

When SplideJS is set to loop and perMove same as the perPage, looping with the right arrow does not work after it loops to the end. If we use other type or if we add focus: 0, it works fine.

{
  type: "loop",
  perPage: 5,
  perMove: 5
}

Reproduction Link

https://woocore.oxyninja.com/product/fresh-retro-bt-speaker/

Steps to Reproduce

_ON_YOUMAYLIKE.destroy();
var _ON_YOUMAYLIKE = new Splide("#-oxyninja_slider-292-126 .splide", {
	type: "loop",
	perPage: 5,
	perMove: 5,
});
_ON_YOUMAYLIKE.mount();

Expected Behaviour

It should loop in the same way as we click/loop with a left arrow.

Rados51 avatar May 30 '22 12:05 Rados51

How about removing perMove? Basically, you don't have to set the option if the number is same with perPage.

NaotoshiFujita avatar May 30 '22 14:05 NaotoshiFujita

@NaotoshiFujita

Thanks, that worked, but if I change it to this:

{
  type: "loop",
  perPage: 4,
  perMove: 2
}

The issue is still the same, not on the link above, but on our staging site. You can try it at this link (new arrival section): https://woocommerce-410353-2033829.cloudwaysapps.com/

_ON_NEWARRIVALS.destroy();
var _ON_NEWARRIVALS = new Splide("#-oxyninja_slider-106-67 .splide", {
	type: "loop",
	perPage: 4,
	perMove: 2,
});
_ON_NEWARRIVALS.mount();

I am not quite sure where to look, if this is kind of a CSS issue or something similar. Thanks :)

Rados51 avatar May 30 '22 18:05 Rados51

Thanks! I've been debugging this issue and found the bug. I'll fix it when I have time.

NaotoshiFujita avatar Jun 01 '22 06:06 NaotoshiFujita

@NaotoshiFujita Thank you! Appreciate it 🔥

Rados51 avatar Jun 01 '22 08:06 Rados51

Fixed in the latest version.

NaotoshiFujita avatar Jun 11 '22 18:06 NaotoshiFujita

@NaotoshiFujita Thank you! 🔥

Rados51 avatar Jun 12 '22 00:06 Rados51