Skip to content

Commit

Permalink
Action bar: escape should not lose focus
Browse files Browse the repository at this point in the history
fixes #91085
  • Loading branch information
isidorn committed Mar 12, 2020
1 parent 70c4776 commit 1c34370
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/vs/base/browser/ui/actionbar/actionbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ export class ActionBar extends Disposable implements IActionRunner {
} else if (event.equals(nextKey)) {
this.focusNext();
} else if (event.equals(KeyCode.Escape)) {
this.cancel();
this._onDidCancel.fire();
} else if (this.isTriggerKeyEvent(event)) {
// Staying out of the else branch even if not triggered
if (this.options.triggerKeys && this.options.triggerKeys.keyDown) {
Expand Down Expand Up @@ -813,14 +813,6 @@ export class ActionBar extends Disposable implements IActionRunner {
}
}

private cancel(): void {
if (document.activeElement instanceof HTMLElement) {
document.activeElement.blur(); // remove focus from focused action
}

this._onDidCancel.fire();
}

run(action: IAction, context?: unknown): Promise<void> {
return this._actionRunner.run(action, context);
}
Expand Down

0 comments on commit 1c34370

Please sign in to comment.