mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user