A way to disable editing on statement inputs

5 views
Skip to first unread message

Francisco

unread,
3:06 PM (7 hours ago) 3:06 PM
to Blockly
Hi all,

I'd like to know if it's possible to disable editing on a specific input in a block, instead of disabling the block whole using this.setEditable(false)
const input = this.appendStatementInput('DEF')
input.appendField('function')
input.connection?.setShadowState({
  type: 'function_call' // preview of the block (similar to mit's scratch!)
})

The purpose here of the non-editable statement input is that it only holds a shadow-state of the function call preview, similar to how it's done in mit's scratch:

Screenshot 2026-01-28 195558.png

and use the next statements below the block as the actual function body :D

Reply all
Reply to author
Forward
0 new messages