mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fixing delete server group error when we try to focus on root (#23019)
This commit is contained in:
@@ -144,6 +144,12 @@ export class AsyncServerTree extends WorkbenchAsyncDataTree<ConnectionProfileGro
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async revealSelectFocusElement(element: ServerTreeElement) {
|
public async revealSelectFocusElement(element: ServerTreeElement) {
|
||||||
|
const dataNode = this.getDataNode(element);
|
||||||
|
// The root of the tree is a special case as it is not rendered
|
||||||
|
// so we instead reveal select and focus on the first child of the root.
|
||||||
|
if (dataNode === this.root) {
|
||||||
|
element = dataNode.children[0].element;
|
||||||
|
}
|
||||||
await this.reveal(element);
|
await this.reveal(element);
|
||||||
await this.setSelection([element]);
|
await this.setSelection([element]);
|
||||||
this.setFocus([element]);
|
this.setFocus([element]);
|
||||||
|
|||||||
Reference in New Issue
Block a user