Update src/elements/emby-scrollbuttons/utils.ts

Co-authored-by: viown <48097677+viown@users.noreply.github.com>
This commit is contained in:
enter-a-random-username
2025-03-28 22:27:58 +01:00
committed by Bill Thornton
parent 038574adfc
commit afe25ee596

View File

@@ -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;