Description
Expected Behavior
After dragging a block (either from the flyout or on the workspace), the 'selected' block (Blockly.selected
) should be cleared. This means that clearing the 'selected' block should be done on mouse up.
Using this, every time a block is picked up on, an 'ui' event is created and can be acted upon.
Actual Behavior
After dragging a block, the 'selected' block is not cleared. The value of Blockly.selected
is still the last block dragged, until a new block is selected or a mouse down event happens.
Currently, since the 'selected' block is not cleared, when dragging a block for the 2nd time in a row (without interacting with anything else in the meantime), no 'ui' event is created, and so it is not as easy as it should to detect that this block was picked up.
Steps to Reproduce
- Launch tests/vertical_playground.html in your browser
- Enable Log Events option
- Drag a block from the flyout to the workspace
- Notice that 3 events are logged: "Create" (when the dragged block is created); "Ui" (when this new block is selected); "Move" (when the block is set on the workspace)
- Without clicking anywhere else first, drag the block again from the workspace to some other position on the workspace
- Notice that only a "Move" event is logged, while we would except a "Ui" event first
Operating System and Browser
Mac OS 10.11.6 Chrome 58.0.3029.110 (64-bit)