Open graphicfox opened 2 years ago
Also reproduced without SSR
I found some workaround for this issue. Here my Carousel component usage:
<template lang="pug">
Carousel(
ref="carousel",
@init="handleInit",
:items-to-show="3",
:wrap-around="isEnabledWrapAround",
:mouse-drag="false",
:touch-drag="false",
:transition="transitionValue",
v-model="selectedIndexModel"
)
</template>
<script lang="ts" setup>
...
const isEnabledWrapAround = ref<boolean>(false);
const transitionValue = ref<number>(0);
const carousel = ref(null);
const handleInit = async () => {
isEnabledWrapAround.value = true;
await nextTick();
transitionValue.value = 300;
};
</script>
Describe the bug On ssr page load the second slide will get shown first because of oder: -1. This causes a really sharp skip to the correct first slide when the carousel ist initialized on client side and the css order jumps from -1 to 1.
To Reproduce
Expected behavior On page load the slider should load all slides in the provided order.
Additional context
Renderd html
Temporarily solution only set wrap around on client side