From 20f171690237fadf047e0a2507a9d6c19383521c Mon Sep 17 00:00:00 2001 From: Jackson Hoang Date: Fri, 6 Nov 2020 15:23:56 -0500 Subject: [PATCH] Fix bug with resize segments not being removed 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. --- src/addons/dragAndDrop/WeekWrapper.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/addons/dragAndDrop/WeekWrapper.js b/src/addons/dragAndDrop/WeekWrapper.js index 645ceab01..f94b752a1 100644 --- a/src/addons/dragAndDrop/WeekWrapper.js +++ b/src/addons/dragAndDrop/WeekWrapper.js @@ -218,8 +218,13 @@ class WeekWrapper extends React.Component { selector.on('select', point => { const bounds = getBoundsForNode(node) - if (!this.state.segment || !pointInBox(bounds, point)) return - this.handleInteractionEnd() + if (!this.state.segment) return + + if (!pointInBox(bounds, point)) { + this.reset() + } else { + this.handleInteractionEnd() + } }) selector.on('dropFromOutside', point => {