mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 01:25:38 -05:00
Fix dnd auto-connecting profiles when dragging (#11935)
* Fix dnd auto-connecting profiles when dragging * Expand connected nodes * fix
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user