Skip to content

Commit caf820b

Browse files
authored
fix(Dnd): Offset is not needed (jquense#1892)
1 parent dbcc578 commit caf820b

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/addons/dragAndDrop/WeekWrapper.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class WeekWrapper extends React.Component {
6565

6666
const slot = getSlotAtX(
6767
bounds,
68-
point.x - this.eventOffsetLeft,
68+
point.x,
6969
rtl,
7070
slotMetrics.slots
7171
)
@@ -160,15 +160,6 @@ class WeekWrapper extends React.Component {
160160
const { isAllDay } = this.props
161161
const { action } = this.context.draggable.dragAndDropAction
162162
const bounds = getBoundsForNode(node)
163-
164-
// eventOffsetLeft is distance from the left of the event to the initial
165-
// mouseDown position. We need this later to compute the new top of the
166-
// event during move operations, since the final location is really a
167-
// delta from this point. note: if we want to DRY this with
168-
// EventContainerWrapper, probably better just to capture the mouseDown
169-
// point here and do the placement computation in handleMove()...
170-
this.eventOffsetLeft = point.x - bounds.left
171-
172163
const isInBox = pointInBox(bounds, point)
173164
return (
174165
action === 'move' || (action === 'resize' && (!isAllDay || isInBox))

0 commit comments

Comments
 (0)