1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

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 GitHub
parent a0a2ca5fb9
commit d139242ca8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -76,7 +76,7 @@ function scrollToWindow({
let scrollToPosition: number; let scrollToPosition: number;
if (direction === ScrollDirection.RIGHT) { 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. // This will be the position to anchor the item at `lastVisibleIndex` to the start of the view window.
const nextItemScrollOffset = lastVisibleIndex * nextItem.offsetWidth; const nextItemScrollOffset = lastVisibleIndex * nextItem.offsetWidth;