Skip to content

fix: Disallow and ignore x and y attributes for blocks in toolbox definitions. #8785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions core/block_flyout_inflater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ export class BlockFlyoutInflater implements IFlyoutInflater {
) {
blockDefinition['disabledReasons'] = [MANUALLY_DISABLED];
}
// These fields used to be allowed and may still be present, but are
// ignored here since everything in the flyout should always be laid out
// linearly.
if ('x' in blockDefinition) {
delete blockDefinition['x'];
}
if ('y' in blockDefinition) {
delete blockDefinition['y'];
}
block = blocks.appendInternal(blockDefinition as blocks.State, workspace);
}

Expand Down
2 changes: 0 additions & 2 deletions core/utils/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ export interface BlockInfo {
disabledReasons?: string[];
enabled?: boolean;
id?: string;
x?: number;
y?: number;
collapsed?: boolean;
inline?: boolean;
data?: string;
Expand Down