scratchfoundation / scratchfoundation/scratch-blocks
Selected block not cleared after dragging a block
@rachel-fenichel is already working on this.
Since May 25, 2017.
- Dominant language
- JavaScript
- Stars
- 2.8k
- Forks
- 1.6k
- Avg merge
- 4h 51m
- Merged PRs (30d)
- 12
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.