mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
fix error message steal focus issue (#22782)
* fix steal focus issue * update comment
This commit is contained in:
@@ -612,8 +612,11 @@ export abstract class Modal extends Disposable implements IThemable {
|
||||
protected set messagesElementVisible(visible: boolean) {
|
||||
if (visible) {
|
||||
if (this._useDefaultMessageBoxLocation) {
|
||||
DOM.prepend(this._modalContent!, this._messageElement!);
|
||||
this.setInitialFocusedElement();
|
||||
// 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!);
|
||||
this.setInitialFocusedElement();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// only do the removal when the messageElement has parent element.
|
||||
|
||||
Reference in New Issue
Block a user