splide icon indicating copy to clipboard operation
splide copied to clipboard

Wrong width of next slide when using padding and gap

Open lukaszahorec opened this issue 1 year ago • 0 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

4.1.3

Description

Hi,

After initial load of slider with using padding and gap, the "next slide" has wrong width respectively the width seems good but its pushed more to the right side and overflowing the container.

If I hit next/prev slide or use method refresh() (or autoplay is true) than it's corrected.

let splide = new Splide( '.splide', { type : 'loop', padding: '181px', perPage: 1, gap: '24px', updateOnMove: true, drag: false, autoplay: false, interval: 5000, });

Reproduction Link

https://codepen.io/luk-z-horec/pen/oNJpdWN

Steps to Reproduce

  1. Use padding
  2. Use gap
  3. Autoplay: false
  4. type: loop

Expected Behaviour

The prev and next slide should have the same visible width.

lukaszahorec avatar Nov 29 '23 13:11 lukaszahorec