Skip to content

Commit

Permalink
fixes #96650
Browse files Browse the repository at this point in the history
  • Loading branch information
sbatten committed Apr 30, 2020
1 parent 102f6d3 commit 889c7d0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/vs/workbench/browser/dnd.ts
Expand Up @@ -576,6 +576,15 @@ export class CompositeDragAndDropObserver extends Disposable {
private constructor() {
super();
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 {
if (this.transferData.hasData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype)) {
Expand Down Expand Up @@ -658,12 +667,8 @@ export class CompositeDragAndDropObserver extends Disposable {
}));
disposableStore.add(new DragAndDropObserver(element, {
onDragEnd: e => {
const { id, type } = draggedItemProvider();

const { type } = draggedItemProvider();
const data = this.readDragData(type);
if (data && data.getData().id === id) {
this.transferData.clearData(type === 'view' ? DraggedViewIdentifier.prototype : DraggedCompositeIdentifier.prototype);
}

if (!data) {
return;
Expand Down

0 comments on commit 889c7d0

Please sign in to comment.