From 3c38e0cc8b06eec144e64d2a7bd3af890fb95efc Mon Sep 17 00:00:00 2001 From: Hale Rankin Date: Tue, 2 Mar 2021 12:11:57 -0800 Subject: [PATCH] Notebook cell and modal fix - follow up after Lucy's 14433. (#14457) * Modal - added code to stop the keyboard event after it is handled. textCell and codeCell - onKey now fired on keydown. * Moved stop method into the conditional with Escape key. --- src/sql/workbench/browser/modal/modal.ts | 1 + .../contrib/notebook/browser/cellViews/codeCell.component.html | 2 +- .../contrib/notebook/browser/cellViews/textCell.component.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sql/workbench/browser/modal/modal.ts b/src/sql/workbench/browser/modal/modal.ts index 4d19bd7e15..c87bf9da5e 100644 --- a/src/sql/workbench/browser/modal/modal.ts +++ b/src/sql/workbench/browser/modal/modal.ts @@ -472,6 +472,7 @@ export abstract class Modal extends Disposable implements IThemable { if (event.equals(KeyCode.Enter)) { this.onAccept(event); } else if (event.equals(KeyCode.Escape)) { + DOM.EventHelper.stop(e, true); this.onClose(event); } else if (event.equals(KeyMod.Shift | KeyCode.Tab)) { this.handleBackwardTab(e); diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/codeCell.component.html b/src/sql/workbench/contrib/notebook/browser/cellViews/codeCell.component.html index 8fa9ca6a30..36fbe586a1 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/codeCell.component.html +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/codeCell.component.html @@ -4,7 +4,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ --> -
+
diff --git a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html index 923efba1c4..402e413bd7 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html +++ b/src/sql/workbench/contrib/notebook/browser/cellViews/textCell.component.html @@ -4,7 +4,7 @@ * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ --> -
+