A11y: The keyboard focus should go back to the close button when 'cancel' is selected on the save changes dialog (fix #174293) (#176040)

This commit is contained in:
Benjamin Pasero
2023-03-03 14:16:15 +01:00
committed by GitHub
parent ff757ef8f4
commit be04757464
@@ -1544,8 +1544,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
// No auto-save on focus change or custom confirmation handler: ask user
if (!autoSave) {
// Switch to editor that we want to handle for confirmation
await this.doOpenEditor(editor);
// Switch to editor that we want to handle for confirmation unless showing already
if (!this.activeEditor || !this.activeEditor.matches(editor)) {
await this.doOpenEditor(editor);
}
// Let editor handle confirmation if implemented
if (typeof editor.closeHandler?.confirm === 'function') {