提交 889c7d09 编写于 作者: S SteVen Batten

fixes #96650

上级 102f6d3a
...@@ -576,6 +576,15 @@ export class CompositeDragAndDropObserver extends Disposable { ...@@ -576,6 +576,15 @@ export class CompositeDragAndDropObserver extends Disposable {
private constructor() { private constructor() {
super(); super();
this.transferData = LocalSelectionTransfer.getInstance<DraggedCompositeIdentifier | DraggedViewIdentifier>(); this.transferData = LocalSelectionTransfer.getInstance<DraggedCompositeIdentifier | DraggedViewIdentifier>();
this._register(this._onDragEnd.event(e => {
const id = e.dragAndDropData.getData().id;
const type = e.dragAndDropData.getData().type;
const data = this.readDragData(type);
if (data && data.getData().id === id) {
this.transferData.clearData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype);
}
}));
} }
private readDragData(type: ViewType): CompositeDragAndDropData | undefined { private readDragData(type: ViewType): CompositeDragAndDropData | undefined {
if (this.transferData.hasData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype)) { if (this.transferData.hasData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype)) {
...@@ -658,12 +667,8 @@ export class CompositeDragAndDropObserver extends Disposable { ...@@ -658,12 +667,8 @@ export class CompositeDragAndDropObserver extends Disposable {
})); }));
disposableStore.add(new DragAndDropObserver(element, { disposableStore.add(new DragAndDropObserver(element, {
onDragEnd: e => { onDragEnd: e => {
const { id, type } = draggedItemProvider(); const { type } = draggedItemProvider();
const data = this.readDragData(type); const data = this.readDragData(type);
if (data && data.getData().id === id) {
this.transferData.clearData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype);
}
if (!data) { if (!data) {
return; return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册