From 72f9c412d87cb2e8942f5bdbad780e73896e0c04 Mon Sep 17 00:00:00 2001 From: HighImKevin Date: Thu, 13 Nov 2025 04:50:22 -0500 Subject: [PATCH] Update logic for scrolling to next up item for flattened shows --- flattenSingleSeasonShows.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/flattenSingleSeasonShows.js b/flattenSingleSeasonShows.js index 820058e..83f1f35 100644 --- a/flattenSingleSeasonShows.js +++ b/flattenSingleSeasonShows.js @@ -256,12 +256,10 @@ const cardOffset = targetCard.offsetLeft; const scrollerPadding = parseInt(window.getComputedStyle(scrollerContainer).paddingLeft, 10) || 0; - // Calculate the translateX value (negative to move left) - // The card offset minus padding gives us how much to translate - const translateX = -(cardOffset - scrollerPadding); - - // Update the transform property on the itemsContainer - itemsContainer.style.transform = `translateX(${translateX}px)`; + // Calculate the scrollToPosition value + // The card offset minus padding gives us how much to scroll + const translateX = (cardOffset - scrollerPadding); + scrollerContainer.scrollToPosition(translateX); // Enable the left scroll button so users can scroll back const scrollButtons = scrollerContainer.closest('.emby-scroller-container')?.querySelector('.emby-scrollbuttons');