Skip to content

Commit 7e235c3

Browse files
committed
fix: Fix bug that allowed dragging blocks from a flyout onto a readonly workspace.
1 parent 180fec2 commit 7e235c3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/flyout_base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ export abstract class Flyout
11031103
* @internal
11041104
*/
11051105
isBlockCreatable(block: BlockSvg): boolean {
1106-
return block.isEnabled();
1106+
return block.isEnabled() && !this.getTargetWorkspace().isReadOnly();
11071107
}
11081108

11091109
/**

core/gesture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ export class Gesture {
894894
'Cannot do a block click because the target block is ' + 'undefined',
895895
);
896896
}
897-
if (this.targetBlock.isEnabled()) {
897+
if (this.flyout.isBlockCreatable(this.targetBlock)) {
898898
if (!eventUtils.getGroup()) {
899899
eventUtils.setGroup(true);
900900
}

0 commit comments

Comments
 (0)