diff --git a/client/src/components/netflix-grid.tsx b/client/src/components/netflix-grid.tsx index 021a8b7..29d6e77 100644 --- a/client/src/components/netflix-grid.tsx +++ b/client/src/components/netflix-grid.tsx @@ -270,10 +270,10 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate const isMobile = window.innerWidth < 768; if (isMobile) { - // On mobile, one full card at a time + // On mobile, one full card at a time - snap to exact position const cardWidth = containerWidth - 24; // Account for container margins (12px each side) const newIndex = Math.round(scrollLeft / cardWidth); - setCurrentIndex(Math.min(newIndex, 9)); // Max 9 for 10 cards (0-indexed) + setCurrentIndex(Math.min(Math.max(newIndex, 0), 9)); // Ensure 0-9 range } } }; @@ -364,8 +364,12 @@ function CategoryRow({ category, onVideoClick, hideScrollButtons = false }: Cate {/* Scrollable video row - in container */}