Skip to content

Commit 5499b07

Browse files
committed
fix: 🐛 resize auto scroll
1 parent 1012b8c commit 5499b07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/row_rnd/hooks/useAutoScroll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function useAutoScroll(target: React.MutableRefObject<HTMLDivElement>) {
4949
const over = Math.abs(e.clientX >= rightBoundRef.current ? e.clientX - rightBoundRef.current : e.clientX - leftBoundRef.current);
5050
speed.current = Math.min(Number((over / CRITICAL_SIZE).toFixed(0)) * DEFAULT_SPEED, MAX_SPEED);
5151

52-
const direction = dir === 'right' ? 1 : -1;
52+
const direction = e.clientX >= rightBoundRef.current ? 1 : -1;
5353
const delta = direction * speed.current;
5454
const loop = () => {
5555
deltaScroll && deltaScroll(delta);

0 commit comments

Comments
 (0)