Skip to content

Commit 424840d

Browse files
committed
fix: [Carousel] pause when hover dot
1 parent 5eb173b commit 424840d

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/components/Carousel/index.tsx

+8-11
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,14 @@ export const Carousel = React.forwardRef<CarouselHandle, CarouselProps>((props,
241241
};
242242

243243
const resetDrag = () => {
244-
stateRef.current = {
245-
first: false,
246-
wrapWidth: stateRef.current.wrapWidth,
247-
hover: false,
248-
startX: 0,
249-
endX: 0,
250-
startY: 0,
251-
canMove: null,
252-
preventClick: false,
253-
pressDown: false,
254-
};
244+
const state = stateRef.current;
245+
246+
state.startX = 0;
247+
state.endX = 0;
248+
state.startY = 0;
249+
state.canMove = null;
250+
state.preventClick = false;
251+
state.pressDown = false;
255252
};
256253

257254
const dragStart = (e: DragEvent) => {

0 commit comments

Comments
 (0)