From d67a5d395cc556165cd827a4959a8431fb07f257 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 16 Oct 2019 16:50:43 +0200 Subject: [PATCH] Avoid handling keyboard shortcuts for `contentEditable` DOM elements (issue 7156) The issue has been open for years now, and has even been marked with `5-good-beginner-bug` for *months*, without any movement. Considering just how simple the suggested solution is, I'm submitting this patch just to close out a long-standing issue. --- web/app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index a0390ca15..17c2a0266 100644 --- a/web/app.js +++ b/web/app.js @@ -2283,7 +2283,8 @@ function webViewerKeyDown(evt) { let curElementTagName = curElement && curElement.tagName.toUpperCase(); if (curElementTagName === 'INPUT' || curElementTagName === 'TEXTAREA' || - curElementTagName === 'SELECT') { + curElementTagName === 'SELECT' || + (curElement && curElement.isContentEditable)) { // Make sure that the secondary toolbar is closed when Escape is pressed. if (evt.keyCode !== 27) { // 'Esc' return;