mirror of
https://github.com/google/blockly.git
synced 2026-01-19 23:07:21 +01:00
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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,6 @@ export interface BlockInfo {
|
||||
disabledReasons?: string[];
|
||||
enabled?: boolean;
|
||||
id?: string;
|
||||
x?: number;
|
||||
y?: number;
|
||||
collapsed?: boolean;
|
||||
inline?: boolean;
|
||||
data?: string;
|
||||
|
||||
Reference in New Issue
Block a user