mirror of
https://github.com/google/blockly.git
synced 2026-01-06 08:30:13 +01:00
fix: dragging blocks by shadows to delete (#8138)
* Revert "fix: dragging shadow blocks (#7992)"
This reverts commit c0e6e6745f.
* fix: dragging by shadow not being deletable
* fix: unselecting shadows
* fix: revert changes to select and unselect
This commit is contained in:
@@ -675,6 +675,17 @@ export class Block implements IASTNodeLocation {
|
||||
return block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns this block if it is a shadow block, or the first non-shadow parent.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
getFirstNonShadowBlock(): this {
|
||||
if (!this.isShadow()) return this;
|
||||
// We can assert the parent is non-null because shadows must have parents.
|
||||
return this.getParent()!.getFirstNonShadowBlock();
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all the blocks that are directly nested inside this one.
|
||||
* Includes value and statement inputs, as well as any following statement.
|
||||
|
||||
Reference in New Issue
Block a user