Skip to content

Commit 34aec3a

Browse files
fix: bug with resize segments not being removed (jquense#1800)
When an event is resize to span multiple rows, the preview segments in the non-ending row would not be removed because the `!pointInBox` would cause an early return. This commit removes segments when the resize action finishes. Co-authored-by: Jackson Hoang <[email protected]>
1 parent 1b186da commit 34aec3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/addons/dragAndDrop/WeekWrapper.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,13 @@ class WeekWrapper extends React.Component {
218218
selector.on('select', point => {
219219
const bounds = getBoundsForNode(node)
220220

221-
if (!this.state.segment || !pointInBox(bounds, point)) return
222-
this.handleInteractionEnd()
221+
if (!this.state.segment) return
222+
223+
if (!pointInBox(bounds, point)) {
224+
this.reset()
225+
} else {
226+
this.handleInteractionEnd()
227+
}
223228
})
224229

225230
selector.on('dropFromOutside', point => {

0 commit comments

Comments
 (0)