fix(editor): should remove drag preview after drop (#9313)

Closes: [BS-2219](https://linear.app/affine-design/issue/BS-2219/拖拽后,原编辑器内容有残留)
This commit is contained in:
Saul-Mirone
2024-12-26 02:41:09 +00:00
parent 70d9cc6b01
commit a595a145f0

View File

@@ -72,9 +72,15 @@ export class DragEventWatcher {
}
};
private readonly _dragEndHandler: UIEventHandler = () => {
private readonly _cleanup = () => {
this.widget.previewHelper.removeDragPreview();
this.widget.clearRaf();
this.widget.hide(true);
this._std.selection.setGroup('gfx', []);
};
private readonly _dragEndHandler: UIEventHandler = () => {
this._cleanup();
};
private readonly _dragMoveHandler: UIEventHandler = ctx => {
@@ -118,9 +124,7 @@ export class DragEventWatcher {
return;
}
this._onDrop(context);
this._std.selection.setGroup('gfx', []);
this.widget.clearRaf();
this.widget.hide(true);
this._cleanup();
};
private readonly _onDragMove = (state: DndEventState) => {