From d139242ca8d1278195a35165865beb7d2ac3c0b1 Mon Sep 17 00:00:00 2001 From: enter-a-random-username <112093608+enter-a-random-username@users.noreply.github.com> Date: Fri, 28 Mar 2025 22:27:58 +0100 Subject: [PATCH] Update src/elements/emby-scrollbuttons/utils.ts Co-authored-by: viown <48097677+viown@users.noreply.github.com> --- src/elements/emby-scrollbuttons/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elements/emby-scrollbuttons/utils.ts b/src/elements/emby-scrollbuttons/utils.ts index adb4c41834..d21a81004b 100644 --- a/src/elements/emby-scrollbuttons/utils.ts +++ b/src/elements/emby-scrollbuttons/utils.ts @@ -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;