Skip to content

Commit

Permalink
fix: bug with resize segments not being removed (jquense#1800)
Browse files Browse the repository at this point in the history
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 <jhoang@atlassian.com>
  • Loading branch information
jkhoang313 and jhoangatl authored Nov 6, 2020
1 parent 1b186da commit 34aec3a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/addons/dragAndDrop/WeekWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 34aec3a

Please sign in to comment.