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:
Beka Westberg
2024-05-17 20:22:53 +00:00
committed by GitHub
parent 5a8969f855
commit 3fd749205f
3 changed files with 14 additions and 48 deletions

View File

@@ -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.