From be81065393655ea76c6bb6ea5ccc66e66c058f4b Mon Sep 17 00:00:00 2001 From: Amazing Marvin <35364886+amazingmarvin@users.noreply.github.com> Date: Fri, 21 Sep 2018 17:24:40 +0200 Subject: [PATCH] fix: use accessors when determining dnd height. (#954) --- src/addons/dragAndDrop/EventContainerWrapper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/addons/dragAndDrop/EventContainerWrapper.js b/src/addons/dragAndDrop/EventContainerWrapper.js index e5f2bde28..e0d0afdcd 100644 --- a/src/addons/dragAndDrop/EventContainerWrapper.js +++ b/src/addons/dragAndDrop/EventContainerWrapper.js @@ -73,7 +73,7 @@ class EventContainerWrapper extends React.Component { handleMove = (point, boundaryBox) => { const { event } = this.context.draggable.dragAndDropAction - const { slotMetrics } = this.props + const { accessors, slotMetrics } = this.props if (!pointInColumn(boundaryBox, point)) { this.reset() @@ -85,9 +85,11 @@ class EventContainerWrapper extends React.Component { boundaryBox ) + let eventStart = accessors.start(event) + let eventEnd = accessors.end(event) let end = dates.add( currentSlot, - dates.diff(event.start, event.end, 'minutes'), + dates.diff(eventStart, eventEnd, 'minutes'), 'minutes' )