mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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);
|
const canDragOver = this._dragAndDrop.onDragOver(undefined, data, targetElement, <any>originalEvent);
|
||||||
|
|
||||||
if (canDragOver.accept) {
|
if (canDragOver.accept) {
|
||||||
return TreeDragOverReactions.acceptBubbleDown(true);
|
return TreeDragOverReactions.acceptBubbleDown(canDragOver.autoExpand);
|
||||||
} else {
|
} else {
|
||||||
return { accept: false };
|
return { accept: false };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,6 +157,14 @@ export class ServerTreeDragAndDrop implements IDragAndDrop {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (canDragOver) {
|
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);
|
return DRAG_OVER_ACCEPT_BUBBLE_DOWN(true);
|
||||||
} else {
|
} else {
|
||||||
return DRAG_OVER_REJECT;
|
return DRAG_OVER_REJECT;
|
||||||
|
|||||||
Reference in New Issue
Block a user