-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Labels
Description
This issue only occurs in MakeCode, and not the blockly-keyboard-experimentation test page.
Reproduction:
- Insert a top-level block without any constrained positions
- Move the block using unconstrained move (modifier key and arrows)
- Attempt to the move the block using constrained move (arrows only)
- The block unexpectedly moves in the same direction you previously moved the block in unconstrained move mode
- The amount the block moves increases on each subsequent arrow key press
Please see screen capture below:

What is happening:
The newLoc passed to the overridden drag method is being unexpectedly updated during constrained moves after an unconstrained move has occurred. This then calls drag.super and in turn this.block.moveDuringDrag which actually translates the block. It is unclear why there is a difference in behaviour between MakeCode and the test page.
A potential fix:
This can be fixed by removing the call to info.updateTotalDelta() inside the moveConstrained method, however, the consequences of doing this are not fully understood by us and we want to avoid any negative side effects.