Skip to content

Commit

Permalink
fix(Dnd): Offset is not needed (jquense#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwatson committed May 17, 2021
1 parent dbcc578 commit caf820b
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/addons/dragAndDrop/WeekWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class WeekWrapper extends React.Component {

const slot = getSlotAtX(
bounds,
point.x - this.eventOffsetLeft,
point.x,
rtl,
slotMetrics.slots
)
Expand Down Expand Up @@ -160,15 +160,6 @@ class WeekWrapper extends React.Component {
const { isAllDay } = this.props
const { action } = this.context.draggable.dragAndDropAction
const bounds = getBoundsForNode(node)

// eventOffsetLeft is distance from the left of the event to the initial
// mouseDown position. We need this later to compute the new top of the
// event during move operations, since the final location is really a
// delta from this point. note: if we want to DRY this with
// EventContainerWrapper, probably better just to capture the mouseDown
// point here and do the placement computation in handleMove()...
this.eventOffsetLeft = point.x - bounds.left

const isInBox = pointInBox(bounds, point)
return (
action === 'move' || (action === 'resize' && (!isAllDay || isInBox))
Expand Down

0 comments on commit caf820b

Please sign in to comment.