Allow to scroll partial images in slider
This commit is contained in:
committed by
Bill Thornton
parent
4410631564
commit
038574adfc
@@ -76,7 +76,7 @@ function scrollToWindow({
|
||||
let scrollToPosition: number;
|
||||
|
||||
if (direction === ScrollDirection.RIGHT) {
|
||||
const nextItem = items[lastVisibleIndex];
|
||||
const nextItem = items[lastVisibleIndex] ? 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;
|
||||
|
||||
Reference in New Issue
Block a user