Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ class EventContainerWrapper extends React.Component {
}

updateParentScroll = (parent, node) => {
if(!this.context.draggable.autoscrollWhenDragging){
return
}

setTimeout(() => {
const draggedEl = qsa(node, '.rbc-addons-dnd-drag-preview')[0]
if (draggedEl) {
Expand Down
4 changes: 4 additions & 0 deletions src/addons/dragAndDrop/withDragAndDrop.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,16 @@ export default function withDragAndDrop(Calendar) {

selectable: PropTypes.oneOf([true, false, 'ignoreEvents']),
resizable: PropTypes.bool,

autoscrollWhenDragging: PropTypes.bool
}

static defaultProps = {
...Calendar.defaultProps,
draggableAccessor: null,
resizableAccessor: null,
resizable: true,
autoscrollWhenDragging: true
}

constructor(...args) {
Expand All @@ -53,6 +56,7 @@ export default function withDragAndDrop(Calendar) {
draggableAccessor: this.props.draggableAccessor,
resizableAccessor: this.props.resizableAccessor,
dragAndDropAction: this.state,
autoscrollWhenDragging: this.props.autoscrollWhenDragging
},
}
}
Expand Down
7 changes: 7 additions & 0 deletions stories/addons/dragAndDrop/props/API.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,10 @@ The <LinkTo kind="addons-drag-and-drop-props" story="resizable">resizable</LinkT
Determines if an event is resizable.

**Note:** `resizable` events must also be draggable. You cannot resize an event with a <LinkTo kind="addons-drag-and-drop-props" story="draggable-accessor">draggableAccessor</LinkTo> prop of `false`.

### autoscrollWhenDragging

- type: `boolean`
- default: `true`

Determines if the calendar will scroll automatically when resizing or moving events