Skip to content

Commit

Permalink
fix: mouse event propagation probs
Browse files Browse the repository at this point in the history
  • Loading branch information
ehahn9 committed Mar 3, 2021
1 parent 368ff2b commit 759a232
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/addons/dragAndDrop/EventWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ class EventWrapper extends React.Component {

handleResizeUp = e => {
if (e.button !== 0) return
e.stopPropagation()
this.context.draggable.onBeginAction(this.props.event, 'resize', 'UP')
}
handleResizeDown = e => {
if (e.button !== 0) return
e.stopPropagation()
this.context.draggable.onBeginAction(this.props.event, 'resize', 'DOWN')
}
handleResizeLeft = e => {
if (e.button !== 0) return
e.stopPropagation()
this.context.draggable.onBeginAction(this.props.event, 'resize', 'LEFT')
}
handleResizeRight = e => {
if (e.button !== 0) return
e.stopPropagation()
this.context.draggable.onBeginAction(this.props.event, 'resize', 'RIGHT')
}
handleStartDragging = e => {
if (e.button === 0) {
if (e.button !== 0) return
// hack: because of the way the anchors are arranged in the DOM, resize
// anchor events will bubble up to the move anchor listener. Don't start
// move operations when we're on a resize anchor.
const isResizeHandle = e.target.className.includes('rbc-addons-dnd-resize')
if (!isResizeHandle)
this.context.draggable.onBeginAction(this.props.event, 'move')
}
}

renderAnchor(direction) {
Expand Down

0 comments on commit 759a232

Please sign in to comment.