You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm using a carousel with three items and showing two (slides-per-page="2") and setting a big scroll hint (--scroll-hint: 200px), on reload the carousel scroll-container seems to scroll to the right side (when browser width is e.g. 900px). Also when scrolling back or forth, the current index doesn't update. Maybe the problem is that the third item is already full in-view?
For context, I'm trying to create a carousel that is inside a container, but breaks out left/right with the scroll-hint property and negative margin-left/right.
To Reproduce
Open codepen, set the browser width to 900px and reload.
oncode
changed the title
Carousel
Initial Carousel position not working when using big scroll-hint
Dec 5, 2024
oncode
changed the title
Initial Carousel position not working when using big scroll-hint
Initial carousel position not working when using big scroll-hint
Dec 5, 2024
oncode
changed the title
Initial carousel position not working when using big scroll-hint
Initial carousel position and current index not working when using big scroll-hint
Dec 5, 2024
Describe the bug
When I'm using a carousel with three items and showing two (
slides-per-page="2"
) and setting a big scroll hint (--scroll-hint: 200px
), on reload the carousel scroll-container seems to scroll to the right side (when browser width is e.g. 900px). Also when scrolling back or forth, the current index doesn't update. Maybe the problem is that the third item is already full in-view?For context, I'm trying to create a carousel that is inside a container, but breaks out left/right with the scroll-hint property and negative margin-left/right.
To Reproduce
Open codepen, set the browser width to 900px and reload.
Demo
https://codepen.io/oncode_pens/pen/RNbrWBm
Screenshots
After loading the codepen carousel is scrolled completely to the right and currentIndex is 0:
Expected initial position of the carousel (0) and when scrolled to right the currentIndex should be 1:
Browser / OS
The text was updated successfully, but these errors were encountered: