Skip to content

Commit 759a232

Browse files
committed
fix: mouse event propagation probs
1 parent 368ff2b commit 759a232

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/addons/dragAndDrop/EventWrapper.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,28 @@ class EventWrapper extends React.Component {
2323

2424
handleResizeUp = e => {
2525
if (e.button !== 0) return
26-
e.stopPropagation()
2726
this.context.draggable.onBeginAction(this.props.event, 'resize', 'UP')
2827
}
2928
handleResizeDown = e => {
3029
if (e.button !== 0) return
31-
e.stopPropagation()
3230
this.context.draggable.onBeginAction(this.props.event, 'resize', 'DOWN')
3331
}
3432
handleResizeLeft = e => {
3533
if (e.button !== 0) return
36-
e.stopPropagation()
3734
this.context.draggable.onBeginAction(this.props.event, 'resize', 'LEFT')
3835
}
3936
handleResizeRight = e => {
4037
if (e.button !== 0) return
41-
e.stopPropagation()
4238
this.context.draggable.onBeginAction(this.props.event, 'resize', 'RIGHT')
4339
}
4440
handleStartDragging = e => {
45-
if (e.button === 0) {
41+
if (e.button !== 0) return
42+
// hack: because of the way the anchors are arranged in the DOM, resize
43+
// anchor events will bubble up to the move anchor listener. Don't start
44+
// move operations when we're on a resize anchor.
45+
const isResizeHandle = e.target.className.includes('rbc-addons-dnd-resize')
46+
if (!isResizeHandle)
4647
this.context.draggable.onBeginAction(this.props.event, 'move')
47-
}
4848
}
4949

5050
renderAnchor(direction) {

0 commit comments

Comments
 (0)