Skip to content

Commit

Permalink
A11y: The keyboard focus should go back to the close button when 'can…
Browse files Browse the repository at this point in the history
…cel' is selected on the save changes dialog (fix microsoft#174293) (microsoft#176040)
  • Loading branch information
bpasero committed Mar 3, 2023
1 parent ff757ef commit be04757
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/vs/workbench/browser/parts/editor/editorGroupView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit be04757

Please sign in to comment.