From a0a2ca5fb925345497225b8fefceaa3ed8786803 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 19:00:34 +0100 Subject: [PATCH] Allow to scroll partial images in slider --- 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 0d925957a6..adb4c41834 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]; + 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;