Skip to content

Commit

Permalink
fix initialization of custom argument editor in function dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
riknoll committed Mar 7, 2025
1 parent 0e55453 commit b9f8b76
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pxtblocks/plugins/functions/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,13 @@ export function createCustomArgumentEditor(typeName: string, ws: Blockly.Workspa
}

function createCustomArgumentBlock(blockType: string, typeName: string, ws: Blockly.Workspace) {
const block = Blockly.utils.xml.createElement("block");
block.setAttribute("type", blockType);

const block = ws.newBlock(blockType);
const mutation = Blockly.utils.xml.createElement("mutation");
mutation.setAttribute("typename", typeName);

block.appendChild(mutation);
block.domToMutation(mutation);

return Blockly.Xml.domToBlock(block, ws);
return block;
}

export function findLegalName(name: string, ws: Blockly.Workspace, block?: CommonFunctionBlock) {
Expand Down

0 comments on commit b9f8b76

Please sign in to comment.