Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dnd: Offset is not needed #1892

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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