diff --git a/src/addons/dragAndDrop/EventContainerWrapper.js b/src/addons/dragAndDrop/EventContainerWrapper.js index a0227146d..63c974bcd 100644 --- a/src/addons/dragAndDrop/EventContainerWrapper.js +++ b/src/addons/dragAndDrop/EventContainerWrapper.js @@ -81,9 +81,15 @@ class EventContainerWrapper extends React.Component { let { start, end } = eventTimes(event, accessors) if (direction === 'UP') { - start = dates.min(newTime, slotMetrics.closestSlotFromDate(end, -1)) + start = dates.min( + newTime, + slotMetrics.closestSlotFromDate(end, -1) || newTime + ) } else if (direction === 'DOWN') { - end = dates.max(newTime, slotMetrics.closestSlotFromDate(start)) + end = dates.max( + newTime, + slotMetrics.closestSlotFromDate(start) || newTime + ) } this.update(event, slotMetrics.getRange(start, end)) diff --git a/stories/DragAndDrop.js b/stories/DragAndDrop.js index 3fd8e2d55..dec32a1b0 100644 --- a/stories/DragAndDrop.js +++ b/stories/DragAndDrop.js @@ -1,8 +1,9 @@ +import moment from 'moment' import React from 'react' import { storiesOf } from '@storybook/react' import { action } from '@storybook/addon-actions' -import { events, Calendar, Views, DragAndDropCalendar } from './helpers' +import { events, Views, DragAndDropCalendar } from './helpers' import customComponents from './helpers/customComponents' storiesOf('Drag and Drop', module) @@ -45,6 +46,37 @@ storiesOf('Drag and Drop', module) /> ) }) + .add( + 'draggable and resizable with event overflows the custom time period', + () => { + return ( + + ) + } + ) .add('draggable and resizable with custom dateCellWrapper', () => { return (