Update src/elements/emby-scrollbuttons/utils.ts
Co-authored-by: viown <48097677+viown@users.noreply.github.com>
This commit is contained in:
committed by
Bill Thornton
parent
038574adfc
commit
afe25ee596
@@ -76,7 +76,7 @@ function scrollToWindow({
|
||||
let scrollToPosition: number;
|
||||
|
||||
if (direction === ScrollDirection.RIGHT) {
|
||||
const nextItem = items[lastVisibleIndex] ? items[lastVisibleIndex] : items[lastVisibleIndex - 1];
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user