mirror of
https://github.com/google/blockly.git
synced 2026-01-08 01:20:12 +01:00
fix: Always draw dragged blocks atop others in the workspace. (#6874)
* fix: Always draw dragged blocks atop others in the workspace. * chore: format --------- Co-authored-by: Beka Westberg <bwestberg@google.com>
This commit is contained in:
@@ -105,13 +105,10 @@ export class BlockDragger implements IBlockDragger {
|
||||
}
|
||||
this.fireDragStartEvent_();
|
||||
|
||||
// Mutators don't have the same type of z-ordering as the normal workspace
|
||||
// during a drag. They have to rely on the order of the blocks in the SVG.
|
||||
// For performance reasons that usually happens at the end of a drag,
|
||||
// but do it at the beginning for mutators.
|
||||
if (this.workspace_.isMutator) {
|
||||
this.draggingBlock_.bringToFront();
|
||||
}
|
||||
// The z-order of blocks depends on their order in the SVG, so move the
|
||||
// block being dragged to the front so that it will appear atop other blocks
|
||||
// in the workspace.
|
||||
this.draggingBlock_.bringToFront(true);
|
||||
|
||||
// During a drag there may be a lot of rerenders, but not field changes.
|
||||
// Turn the cache on so we don't do spurious remeasures during the drag.
|
||||
|
||||
Reference in New Issue
Block a user