mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
update modal.ts (#16736)
This commit is contained in:
@@ -598,13 +598,17 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
DOM.prepend(this._modalContent!, this._messageElement!);
|
DOM.prepend(this._modalContent!, this._messageElement!);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
DOM.removeNode(this._messageElement!);
|
// only do the removal when the messageElement has parent element.
|
||||||
// Set the focus to first focus element if the focus is not within the dialog
|
if (this._messageElement!.parentElement) {
|
||||||
if (!DOM.isAncestor(document.activeElement, this._bodyContainer!)) {
|
// Reset the focus if keyboard focus is currently in the message area.
|
||||||
|
const resetFocus = DOM.isAncestor(document.activeElement, this._messageElement!);
|
||||||
|
this._messageElement!.remove();
|
||||||
|
if (resetFocus) {
|
||||||
this.setInitialFocusedElement();
|
this.setInitialFocusedElement();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set spinner element to show or hide
|
* Set spinner element to show or hide
|
||||||
|
|||||||
Reference in New Issue
Block a user