Skip to content

Commit

Permalink
fix: drag single block if there is only one selected block
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Nov 10, 2023
1 parent 1c073de commit 2bdda63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion packages/visual-flow/src/model/block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export abstract class Block extends ModelBase {
this.graph.clearSelectedBlocks();
targetSocket.onMouseDown();
} else {
if (this.selected) {
if (this.selected && this.graph.selectedBlocks.size > 1) {
for (const block of this.graph.selectedBlocks) {
if (block.dockedToBlock) {
block.undockFrom();
Expand Down
1 change: 0 additions & 1 deletion packages/visual-flow/src/model/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,6 @@ export class Graph {
this.addSelectedBlock(block, shiftKey);
this.overwriteRecord();
} else {
if (!shiftKey) this.clearSelectedBlocks();
this.pushRecord();
}
block.pendingClick = false;
Expand Down

0 comments on commit 2bdda63

Please sign in to comment.