fix(editor): can not select the block after undo the drag from canvas to note (#12473)

Close [BS-3509](https://linear.app/affine-design/issue/BS-3509/embed拖入note,然后撤销,形成的block刷新后才可选中,且只能进行有限交互)

### Before

https://github.com/user-attachments/assets/4c83f9ba-1a99-427f-824d-7e946e55e737

### After

https://github.com/user-attachments/assets/e6a28478-0af4-4358-a353-e0c2e8edb0f9

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **Bug Fixes**
	- Improved block selection reliability after dragging a block into a note and performing an undo action, ensuring the block remains selectable.

- **Tests**
	- Added an end-to-end test to verify block selection after dragging and undo operations in edgeless mode.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
L-Sun
2025-05-23 07:28:30 +00:00
parent 41781902f6
commit 0902b2b9c9
4 changed files with 43 additions and 19 deletions

View File

@@ -710,6 +710,7 @@ export class DragEventWatcher {
dropPayload: DropPayload,
point: Point
) => {
this.std.store.captureSync();
if (this.mode === 'edgeless') {
this._onEdgelessDrop(dropBlock, dragPayload, dropPayload, point);
} else {