google / codeworld

Educational computer programming environment using Haskell
http://code.world
Apache License 2.0
1.24k stars 197 forks source link

Orphaned blocks are not disabled when placed with a single click #232

Open cdsmith opened 8 years ago

cdsmith commented 8 years ago

Create a function with one parameter. If you just click once on the parameter name, this is interpreted as grabbing the block and dropping it immediately. There seems to be a race condition or some other weird behavior here: sometimes the dropped block is disabled, but other times, it's not - leading to a top-level "x" expression in the program. Dragging that block anywhere does cause it to become disabled.

cdsmith commented 8 years ago

Actually, this seems to be an issue for top-level blocks, as well. Just clicking them once adds an enabled version to the workspace.

stefaj commented 8 years ago

I'm also not sure exactly why this happens. For some reason the drag flag is still set when the block is placed. This seems to be the case when the block is spawned, but not yet moved. I'm adding this as a note to come back later to.

cdsmith commented 8 years ago

IIRC, this orphan-disabling thing is a core blockly feature. When you figure this out, you might consider contributing the fix upstream, as well.