Skip to content

Commit 0ed6c82

Browse files
authored
fix: Disallow and ignore x and y attributes for blocks in toolbox definitions. (#8785)
* fix: Disallow and ignore x and y attributes for blocks in toolbox definitions. * chore: Clarify comment in BlockFlyoutInflater.
1 parent 22dbd75 commit 0ed6c82

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

core/block_flyout_inflater.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ export class BlockFlyoutInflater implements IFlyoutInflater {
101101
) {
102102
blockDefinition['disabledReasons'] = [MANUALLY_DISABLED];
103103
}
104+
// These fields used to be allowed and may still be present, but are
105+
// ignored here since everything in the flyout should always be laid out
106+
// linearly.
107+
if ('x' in blockDefinition) {
108+
delete blockDefinition['x'];
109+
}
110+
if ('y' in blockDefinition) {
111+
delete blockDefinition['y'];
112+
}
104113
block = blocks.appendInternal(blockDefinition as blocks.State, workspace);
105114
}
106115

core/utils/toolbox.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export interface BlockInfo {
2424
disabledReasons?: string[];
2525
enabled?: boolean;
2626
id?: string;
27-
x?: number;
28-
y?: number;
2927
collapsed?: boolean;
3028
inline?: boolean;
3129
data?: string;

0 commit comments

Comments
 (0)