Skip to content

Commit 32b6974

Browse files
committed
Fix incorrect onDrag() arity when user scrolls page
1 parent 9886cec commit 32b6974

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/DraggableCore.es6

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export default class DraggableCore extends React.Component {
336336

337337
// When the user scrolls, adjust internal state so the draggable moves along the page properly.
338338
// This only fires when a drag is active.
339-
handleScroll = () => {
339+
handleScroll = (e) => {
340340
let s = this.state, x = document.body.scrollLeft, y = document.body.scrollTop;
341341

342342
// Create the usual event, but make the scroll offset our deltas.
@@ -349,7 +349,7 @@ export default class DraggableCore extends React.Component {
349349
lastY: s.lastY + coreEvent.deltaY
350350
});
351351

352-
this.props.onDrag(coreEvent);
352+
this.props.onDrag(e, coreEvent);
353353
};
354354

355355
// On mousedown, consider the drag started.

0 commit comments

Comments
 (0)