For element ... block editor bug

I encountered a pretty severe block editor bug with the for element [value] of [list] block. Steps to repro:

  1. in a brand new project, drag a for element [value] of [list] block into the on start.
  2. click the drop-down next to list and select Delete the "list" variable.
  3. 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.
1 Like

Hm, weird bug, good catch. It looks like it’s actually fixed in /beta / our current development branches, as we have had a bunch of updates to blockly since the last release of arcade and one of them must have incidentally fixed this

1 Like