diff --git a/src/containers/paint-editor.jsx b/src/containers/paint-editor.jsx index 3df93c19fa..1ebd3c204a 100644 --- a/src/containers/paint-editor.jsx +++ b/src/containers/paint-editor.jsx @@ -256,7 +256,11 @@ class PaintEditor extends React.Component { } onMouseDown (event) { if (event.target === paper.view.element && - document.activeElement instanceof HTMLInputElement) { + ( + document.activeElement instanceof HTMLInputElement || + document.activeElement instanceof HTMLTextAreaElement + ) + ) { document.activeElement.blur(); } diff --git a/src/helper/selection-tools/nudge-tool.js b/src/helper/selection-tools/nudge-tool.js index 96c453bdf5..8705971476 100644 --- a/src/helper/selection-tools/nudge-tool.js +++ b/src/helper/selection-tools/nudge-tool.js @@ -21,7 +21,7 @@ class NudgeTool { this.boundingBoxTool.isBitmap = mode in BitmapModes; } onKeyDown (event) { - if (event.event.target instanceof HTMLInputElement) { + if (event.event.target instanceof HTMLInputElement || event.event.target instanceof HTMLTextAreaElement) { // Ignore nudge if a text input field is focused return; } diff --git a/src/helper/selection-tools/reshape-tool.js b/src/helper/selection-tools/reshape-tool.js index 9614218885..f8ead41c15 100644 --- a/src/helper/selection-tools/reshape-tool.js +++ b/src/helper/selection-tools/reshape-tool.js @@ -310,7 +310,7 @@ class ReshapeTool extends paper.Tool { this.active = false; } handleKeyDown (event) { - if (event.event.target instanceof HTMLInputElement) { + if (event.event.target instanceof HTMLInputElement || event.event.target instanceof HTMLTextAreaElement) { // Ignore nudge if a text input field is focused return; } diff --git a/src/helper/tools/text-tool.js b/src/helper/tools/text-tool.js index 9d5825f35d..e42f745d2c 100644 --- a/src/helper/tools/text-tool.js +++ b/src/helper/tools/text-tool.js @@ -282,7 +282,7 @@ class TextTool extends paper.Tool { this.active = false; } handleKeyUp (event) { - if (event.event.target instanceof HTMLInputElement) { + if (event.event.target instanceof HTMLInputElement || event.event.target instanceof HTMLTextAreaElement) { // Ignore nudge if a text input field is focused return; } @@ -292,7 +292,7 @@ class TextTool extends paper.Tool { } } handleKeyDown (event) { - if (event.event.target instanceof HTMLInputElement) { + if (event.event.target instanceof HTMLInputElement || event.event.target instanceof HTMLTextAreaElement) { // Ignore nudge if a text input field is focused return; } diff --git a/src/hocs/keyboard-shortcuts-hoc.jsx b/src/hocs/keyboard-shortcuts-hoc.jsx index f4603c7167..e1637905e6 100644 --- a/src/hocs/keyboard-shortcuts-hoc.jsx +++ b/src/hocs/keyboard-shortcuts-hoc.jsx @@ -50,7 +50,7 @@ const KeyboardShortcutsHOC = function (WrappedComponent) { ]); } handleKeyPress (event) { - if (event.target instanceof HTMLInputElement) { + if (event.target instanceof HTMLInputElement || event.target instanceof HTMLTextAreaElement) { // Ignore keyboard shortcuts if a text input field is focused return; }