I encountered a pretty severe block editor bug with the for element [value] of [list]
block. Steps to repro:
- in a brand new project, drag a
for element [value] of [list]
block into theon start
. - click the drop-down next to
list
and selectDelete the "list" variable
. - click the same drop-down again and the block becomes stuck to the cursor. It cannot be trashed or placed. Undo doesn’t work. The only way I was able to recover was reloading the page. (Thankfully nothing was lost!)
It looks like there’s a script error associated with opening the menu the second time:
Uncaught TypeError: Cannot read property 'type' of null
at Blockly.FieldVariable.dropdownCreate [as menuGenerator_] (pxtblockly.js:1)
at Blockly.FieldVariable.Blockly.FieldDropdown.getOptions (pxtblockly.js:1)
at Blockly.FieldVariable.Blockly.FieldDropdown.showEditor_ (pxtblockly.js:1)
at Blockly.TouchGesture.Blockly.Gesture.doFieldClick_ (pxtblockly.js:1)
at Blockly.TouchGesture.Blockly.Gesture.handleUp (pxtblockly.js:1)
at Blockly.TouchGesture.handleUp (pxtblockly.js:1)
at HTMLDocument.i (pxtblockly.js:1)
after which there are warnings after every click:
Tried to start the same gesture twice.