mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix error message steal focus issue (#22782)
* fix steal focus issue * update comment
This commit is contained in:
@@ -612,9 +612,12 @@ export abstract class Modal extends Disposable implements IThemable {
|
|||||||
protected set messagesElementVisible(visible: boolean) {
|
protected set messagesElementVisible(visible: boolean) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
if (this._useDefaultMessageBoxLocation) {
|
if (this._useDefaultMessageBoxLocation) {
|
||||||
|
// To avoid stealing focus from the user, only reset the keyboard focus when the message is not currently visible.
|
||||||
|
if (!this._messageElement!.parentNode) {
|
||||||
DOM.prepend(this._modalContent!, this._messageElement!);
|
DOM.prepend(this._modalContent!, this._messageElement!);
|
||||||
this.setInitialFocusedElement();
|
this.setInitialFocusedElement();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// only do the removal when the messageElement has parent element.
|
// only do the removal when the messageElement has parent element.
|
||||||
if (this._messageElement!.parentElement) {
|
if (this._messageElement!.parentElement) {
|
||||||
|
|||||||
Reference in New Issue
Block a user