splide
splide copied to clipboard
Wrong width of next slide when using padding and gap
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
- Use padding
- Use gap
- Autoplay: false
- type: loop
Expected Behaviour
The prev and next slide should have the same visible width.