mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -05:00
Merge from vscode 2a36b7d0d527bf408bae4f96b8386db9d9455113 (#10237)
This commit is contained in:
@@ -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)) {
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user