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

Allow to scroll partial images in slider

This commit is contained in:
enter-a-random-username 2025-03-28 19:00:34 +01:00 committed by GitHub
parent 27e92802d5
commit a0a2ca5fb9
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]; 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. // 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;