Open SamTyurenkov opened 7 months ago
I am having the same issue like yours as well, It shifts 136.5px for me, It becomes normal after triggering a 'move' event.(But it couldn't be a workaround for my case)
@yyywork Have similar issue, but in my case set focus
option to 1
solved the problem.
My whole optionset:
new Splide(carousel, {
type: "loop",
mediaQuery: "min",
gap: 20,
focus: 1,
breakpoints: {
1024: {
perMove: 1,
perPage: 2,
},
},
}).mount();
Checks
Version
v4
Description
Right after initialization, .splide__list gets a translateX(10px) for a small slider where all slides are visible
With same code, when slides exceed container, splide__list gets a translateX(0) on initialization.
This behaviour seems inconsistent and cause an annoying layout shift after initialization.
Reproduction Link
No response
Steps to Reproduce
Expected Behaviour
no layout shift after initialization