fix: flyout id is different than first placed block (#7618)

* add saveIds param and logic to save correctly

* remove whitespace

* add saveIds to recursive calls

* run format

* change name from addIds to saveIds

* add saveIds test

* change blockId on false saveIds to undefined
This commit is contained in:
Trey Pisano
2023-11-01 11:52:27 -04:00
committed by GitHub
parent 666a393ac5
commit 73841995ec
3 changed files with 28 additions and 6 deletions

View File

@@ -1213,7 +1213,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout {
// Clone the block.
// TODO(#7432): Add a saveIds parameter to `save`.
const json = blocks.save(oldBlock) as blocks.State;
const json = blocks.save(oldBlock, {saveIds: false}) as blocks.State;
// Normallly this resizes leading to weird jumps. Save it for terminateDrag.
targetWorkspace.setResizesEnabled(false);
const block = blocks.append(json, targetWorkspace) as BlockSvg;