From 636c8b8703f38674b3c45c06bf619fa88c7fa25f Mon Sep 17 00:00:00 2001 From: Danny Budzinski Date: Fri, 19 Jan 2024 10:13:20 +0100 Subject: [PATCH] chore: add log statements for slider debug --- src/components/TileDock/TileDock.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/TileDock/TileDock.tsx b/src/components/TileDock/TileDock.tsx index 6375ea0a2..ba6edf876 100644 --- a/src/components/TileDock/TileDock.tsx +++ b/src/components/TileDock/TileDock.tsx @@ -98,6 +98,8 @@ function TileDock({ const slide = useCallback( (direction: Direction): void => { + console.info(`Slide to the ${direction}. (transition = ${hasTransition})`); + if (hasTransition) { return; } @@ -159,6 +161,7 @@ function TileDock({ const direction: Direction = newPosition.x < touchPosition.x ? 'right' : 'left'; if (movementX > minimalTouchMovement && movementX > movementY) { + console.info(`Touch ${direction}! (${movementX}, ${movementY})`); slide(direction); } @@ -202,7 +205,9 @@ function TileDock({ }, [doAnimationReset, index, items.length, slideToIndex, tileWidth, tilesToShow, transitionBasis]); const handleTransitionEnd = (event: React.TransitionEvent) => { + console.info('Transition end'); if (event.target === frameRef.current) { + console.info('Transition reset'); setDoAnimationReset(true); setHasTransition(false); }