Skip to content

Commit

Permalink
Also modify outgoing deltaX/Y on bounds hit.
Browse files Browse the repository at this point in the history
  • Loading branch information
STRML committed Feb 10, 2016
1 parent f6670f6 commit ee223f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Draggable.es6
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ export default class Draggable extends React.Component {
newState.slackX = this.state.slackX + (clientX - newState.clientX);
newState.slackY = this.state.slackY + (clientY - newState.clientY);

// Update the event we fire.
// Update the event we fire to reflect what really happened after bounds took effect.
uiEvent.position.left = clientX;
uiEvent.position.top = clientY;
uiEvent.deltaX = newState.clientX - this.state.clientX;
uiEvent.deltaY = newState.clientY - this.state.clientY;
}

// Short-circuit if user's callback killed it.
Expand Down

0 comments on commit ee223f2

Please sign in to comment.