handle the keyboard event properly in hyperlink (#16508)

* handle the keyboard event properly in hyperlink

* fix a couple more issues
This commit is contained in:
Alan Ren
2021-08-02 10:39:36 -07:00
committed by GitHub
parent 373a519f25
commit 748bb53173
6 changed files with 36 additions and 5 deletions

View File

@@ -449,6 +449,7 @@ export abstract class Modal extends Disposable implements IThemable {
if (context[context.length - 1] === this._staticKey) {
let event = new StandardKeyboardEvent(e);
if (event.equals(KeyCode.Enter)) {
DOM.EventHelper.stop(e, true);
this.onAccept(event);
} else if (event.equals(KeyCode.Escape)) {
DOM.EventHelper.stop(e, true);