Skip to content

Commit

Permalink
fix: 🐛 not clean selection when mousedown
Browse files Browse the repository at this point in the history
  • Loading branch information
NewByVector committed Jun 13, 2021
1 parent 1637984 commit d6195a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/x6/src/graph/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ export class SelectionManager extends Base {

protected startListening() {
this.graph.on('blank:mousedown', this.onBlankMouseDown, this)
this.graph.on('blank:click', this.onBlankClick, this)
this.graph.on('cell:mousemove', this.onCellMouseMove, this)
this.graph.on('cell:mouseup', this.onCellMouseUp, this)
this.widget.on('box:mousedown', this.onBoxMouseDown, this)
}

protected stopListening() {
this.graph.off('blank:mousedown', this.onBlankMouseDown, this)
this.graph.off('blank:click', this.onBlankClick, this)
this.graph.off('cell:mousemove', this.onCellMouseMove, this)
this.graph.off('cell:mouseup', this.onCellMouseUp, this)
this.widget.off('box:mousedown', this.onBoxMouseDown, this)
Expand All @@ -60,11 +62,13 @@ export class SelectionManager extends Base {
!this.graph.panning.allowPanning(e, true))
) {
this.startRubberband(e)
} else {
this.clean()
}
}

protected onBlankClick() {
this.clean()
}

allowRubberband(e: JQuery.MouseDownEvent, strict?: boolean) {
return (
!this.rubberbandDisabled &&
Expand Down

0 comments on commit d6195a7

Please sign in to comment.