Merge pull request #6676 from enter-a-random-username/patch-1

Allow to scroll partial images in slider
This commit is contained in:
Bill Thornton
2025-07-09 13:12:43 -04:00
committed by GitHub

View File

@@ -76,7 +76,7 @@ function scrollToWindow({
let scrollToPosition: number;
if (direction === ScrollDirection.RIGHT) {
const nextItem = items[lastVisibleIndex];
const nextItem = items[lastVisibleIndex] || items[lastVisibleIndex - 1];
// This will be the position to anchor the item at `lastVisibleIndex` to the start of the view window.
const nextItemScrollOffset = lastVisibleIndex * nextItem.offsetWidth;