summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/js/language/text-scanner.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/js/language/text-scanner.js b/ext/js/language/text-scanner.js
index 13db91d5..7c1b5b33 100644
--- a/ext/js/language/text-scanner.js
+++ b/ext/js/language/text-scanner.js
@@ -562,6 +562,7 @@ export class TextScanner extends EventDispatcher {
*/
_onKeyDown(e) {
if (this._lastMouseMove !== null && (e.ctrlKey || e.shiftKey || e.altKey || e.metaKey)) {
+ if (this._inputtingText()) { return; }
const syntheticMouseEvent = new MouseEvent(this._lastMouseMove.type, {
screenX: this._lastMouseMove.screenX,
screenY: this._lastMouseMove.screenY,
@@ -580,6 +581,18 @@ export class TextScanner extends EventDispatcher {
}
/**
+ * @returns {boolean}
+ */
+ _inputtingText() {
+ const activeElement = document.activeElement;
+ if (activeElement && activeElement instanceof HTMLElement) {
+ if (activeElement.nodeName === 'INPUT' || activeElement.nodeName === 'TEXTAREA') { return true; }
+ if (activeElement.isContentEditable) { return true; }
+ }
+ return false;
+ }
+
+ /**
* @param {MouseEvent} e
* @returns {boolean|void}
*/