Improve video carousel scrolling for a smoother user experience
Add console logs to the `CategoryRow` component in `netflix-grid.tsx` to debug and improve the infinite scrolling behavior of video carousels. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/mZpi7Z1
This commit is contained in:
parent
8997338812
commit
e23fa462eb
@ -145,10 +145,13 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
|
|
||||||
let targetScroll;
|
let targetScroll;
|
||||||
|
|
||||||
|
console.log('Scroll debug:', { direction, currentScroll, maxScroll, scrollAmount });
|
||||||
|
|
||||||
if (direction === 'left') {
|
if (direction === 'left') {
|
||||||
if (currentScroll <= 5) {
|
if (currentScroll <= 5) {
|
||||||
// Jump to end for infinite loop
|
// Jump to end for infinite loop
|
||||||
targetScroll = maxScroll;
|
targetScroll = maxScroll;
|
||||||
|
console.log('Jumping to end:', targetScroll);
|
||||||
} else {
|
} else {
|
||||||
targetScroll = Math.max(0, currentScroll - scrollAmount);
|
targetScroll = Math.max(0, currentScroll - scrollAmount);
|
||||||
}
|
}
|
||||||
@ -156,6 +159,7 @@ function CategoryRow({ category, onVideoClick }: CategoryRowProps) {
|
|||||||
if (currentScroll >= maxScroll - 50) {
|
if (currentScroll >= maxScroll - 50) {
|
||||||
// Jump to beginning for infinite loop
|
// Jump to beginning for infinite loop
|
||||||
targetScroll = 0;
|
targetScroll = 0;
|
||||||
|
console.log('Jumping to beginning:', targetScroll);
|
||||||
} else {
|
} else {
|
||||||
targetScroll = Math.min(maxScroll, currentScroll + scrollAmount);
|
targetScroll = Math.min(maxScroll, currentScroll + scrollAmount);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user