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.clearRaf();
|
||||||
this.widget.hide(true);
|
this.widget.hide(true);
|
||||||
|
this._std.selection.setGroup('gfx', []);
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly _dragEndHandler: UIEventHandler = () => {
|
||||||
|
this._cleanup();
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly _dragMoveHandler: UIEventHandler = ctx => {
|
private readonly _dragMoveHandler: UIEventHandler = ctx => {
|
||||||
@@ -118,9 +124,7 @@ export class DragEventWatcher {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._onDrop(context);
|
this._onDrop(context);
|
||||||
this._std.selection.setGroup('gfx', []);
|
this._cleanup();
|
||||||
this.widget.clearRaf();
|
|
||||||
this.widget.hide(true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly _onDragMove = (state: DndEventState) => {
|
private readonly _onDragMove = (state: DndEventState) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user