fix(editor): undo should remove the new frame created by dragging (#11303)

Close [BS-2848](https://linear.app/affine-design/issue/BS-2848/但我发现frame创建后,要撤销两次才能删掉)
This commit is contained in:
L-Sun
2025-04-01 04:41:44 +00:00
parent c3a5301d5b
commit e7f5601303
2 changed files with 9 additions and 5 deletions
@@ -38,9 +38,7 @@ export class FrameTool extends BaseTool {
override dragEnd(): void {
if (this._frame) {
const frame = this._frame;
this.doc.transact(() => {
frame.pop('xywh');
});
frame.pop('xywh');
// @ts-expect-error TODO: refactor gfx tool
this.gfx.tool.setTool('default');
this.gfx.selection.set({
@@ -52,8 +50,6 @@ export class FrameTool extends BaseTool {
frame,
getTopElements(this.frameManager.getElementsInFrameBound(frame))
);
this.doc.captureSync();
}
this._frame = null;