Skip to content

Commit afa8468

Browse files
OldDreamhuangyuning
andauthored
fix: Correct resizing event bug in Week & Day (jquense#2143)
Co-authored-by: huangyuning <[email protected]>
1 parent 89dd0fb commit afa8468

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

examples/demos/dnd.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class Dnd extends React.Component {
6868

6969
resizeEvent = ({ event, start, end }) => {
7070
const { events } = this.state
71-
7271
const nextEvents = events.map(existingEvent => {
7372
return existingEvent.id == event.id
7473
? { ...existingEvent, start, end }

src/addons/dragAndDrop/EventContainerWrapper.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,20 @@ class EventContainerWrapper extends React.Component {
161161
selector.on('select', point => {
162162
const bounds = getBoundsForNode(node)
163163
isBeingDragged = false
164-
if (!this.state.event || !pointInColumn(bounds, point)) return
165-
this.handleInteractionEnd()
164+
const { dragAndDropAction } = this.context.draggable
165+
if (dragAndDropAction.action === 'resize') {
166+
this.handleInteractionEnd()
167+
} else if (!this.state.event || !pointInColumn(bounds, point)) {
168+
return
169+
} else {
170+
this.handleInteractionEnd()
171+
}
166172
})
167173

168174
selector.on('click', () => {
169175
if (isBeingDragged) this.reset()
170176
this.context.draggable.onEnd(null)
171177
})
172-
173178
selector.on('reset', () => {
174179
this.reset()
175180
this.context.draggable.onEnd(null)
@@ -179,7 +184,6 @@ class EventContainerWrapper extends React.Component {
179184
handleInteractionEnd = () => {
180185
const { resource } = this.props
181186
const { event } = this.state
182-
183187
this.reset()
184188

185189
this.context.draggable.onEnd({

0 commit comments

Comments
 (0)