From caf820b36ff9eb6b3ec7a0ea7f4c81a190a5eee8 Mon Sep 17 00:00:00 2001 From: Tim Watson Date: Mon, 17 May 2021 06:26:59 -0700 Subject: [PATCH] fix(Dnd): Offset is not needed (#1892) --- src/addons/dragAndDrop/WeekWrapper.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/addons/dragAndDrop/WeekWrapper.js b/src/addons/dragAndDrop/WeekWrapper.js index ad9517787..c302785c6 100644 --- a/src/addons/dragAndDrop/WeekWrapper.js +++ b/src/addons/dragAndDrop/WeekWrapper.js @@ -65,7 +65,7 @@ class WeekWrapper extends React.Component { const slot = getSlotAtX( bounds, - point.x - this.eventOffsetLeft, + point.x, rtl, slotMetrics.slots ) @@ -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))