Fix dnd auto-connecting profiles when dragging (#11935)

* Fix dnd auto-connecting profiles when dragging

* Expand connected nodes

* fix
This commit is contained in:
Charles Gagnon
2020-08-24 18:07:08 -07:00
committed by GitHub
parent bd2ab6071d
commit 54826b5fe3
2 changed files with 9 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ export class AsyncServerTreeDragAndDrop implements ITreeDragAndDrop<ServerTreeEl
const canDragOver = this._dragAndDrop.onDragOver(undefined, data, targetElement, <any>originalEvent);
if (canDragOver.accept) {
return TreeDragOverReactions.acceptBubbleDown(true);
return TreeDragOverReactions.acceptBubbleDown(canDragOver.autoExpand);
} else {
return { accept: false };
}

View File

@@ -157,6 +157,14 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
}
if (canDragOver) {
if (targetElement instanceof ConnectionProfile) {
const isConnected = this._connectionManagementService.isProfileConnected(targetElement);
// Don't auto-expand disconnected connections - doing so will try to connect the connection
// when expanded which is not something we want to support currently
return DRAG_OVER_ACCEPT_BUBBLE_DOWN(isConnected);
}
// Auto-expand other elements (groups, tree nodes) so their children can be
// exposed for further dragging
return DRAG_OVER_ACCEPT_BUBBLE_DOWN(true);
} else {
return DRAG_OVER_REJECT;