Skip to content

Commit

Permalink
fix: [Carousel] pause when hover dot
Browse files Browse the repository at this point in the history
  • Loading branch information
akai committed Jan 18, 2021
1 parent 5eb173b commit 424840d
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/components/Carousel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,14 @@ export const Carousel = React.forwardRef<CarouselHandle, CarouselProps>((props,
};

const resetDrag = () => {
stateRef.current = {
first: false,
wrapWidth: stateRef.current.wrapWidth,
hover: false,
startX: 0,
endX: 0,
startY: 0,
canMove: null,
preventClick: false,
pressDown: false,
};
const state = stateRef.current;

state.startX = 0;
state.endX = 0;
state.startY = 0;
state.canMove = null;
state.preventClick = false;
state.pressDown = false;
};

const dragStart = (e: DragEvent) => {
Expand Down

0 comments on commit 424840d

Please sign in to comment.