Skip to content
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
13 changes: 10 additions & 3 deletions src/addons/dragAndDrop/EventContainerWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ class EventContainerWrapper extends React.Component {

_selectable = () => {
let node = findDOMNode(this)
let isBeingDragged = false
let selector = (this._selector = new Selection(() =>
node.closest('.rbc-time-view')
))
Expand Down Expand Up @@ -177,16 +178,22 @@ class EventContainerWrapper extends React.Component {
this.handleDropFromOutside(point, bounds)
})

selector.on('selectStart', () => this.context.draggable.onStart())
selector.on('selectStart', () => {
isBeingDragged = true
this.context.draggable.onStart()
})

selector.on('select', point => {
const bounds = getBoundsForNode(node)

isBeingDragged = false
if (!this.state.event || !pointInColumn(bounds, point)) return
this.handleInteractionEnd()
})

selector.on('click', () => this.context.draggable.onEnd(null))
selector.on('click', () => {
if (isBeingDragged) this.reset()
this.context.draggable.onEnd(null)
})

selector.on('reset', () => {
this.reset()
Expand Down