Skip to content

Commit

Permalink
chore: add log statements for slider debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dbudzins committed Jan 19, 2024
1 parent 0cfc177 commit 636c8b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/TileDock/TileDock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ function TileDock<T>({

const slide = useCallback(
(direction: Direction): void => {
console.info(`Slide to the ${direction}. (transition = ${hasTransition})`);

if (hasTransition) {
return;
}
Expand Down Expand Up @@ -159,6 +161,7 @@ function TileDock<T>({
const direction: Direction = newPosition.x < touchPosition.x ? 'right' : 'left';

if (movementX > minimalTouchMovement && movementX > movementY) {
console.info(`Touch ${direction}! (${movementX}, ${movementY})`);
slide(direction);
}

Expand Down Expand Up @@ -202,7 +205,9 @@ function TileDock<T>({
}, [doAnimationReset, index, items.length, slideToIndex, tileWidth, tilesToShow, transitionBasis]);

const handleTransitionEnd = (event: React.TransitionEvent<HTMLUListElement>) => {
console.info('Transition end');
if (event.target === frameRef.current) {
console.info('Transition reset');
setDoAnimationReset(true);
setHasTransition(false);
}
Expand Down

0 comments on commit 636c8b8

Please sign in to comment.