From 3fd6f3023f4e90a4af7479bad51bff40b48bc43f Mon Sep 17 00:00:00 2001 From: David Luzar Date: Wed, 8 Apr 2020 20:56:27 +0200 Subject: [PATCH] support newline on shift+enter (#1324) --- src/element/textWysiwyg.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 32afe6ca..43146b8c 100644 --- a/src/element/textWysiwyg.tsx +++ b/src/element/textWysiwyg.tsx @@ -108,18 +108,13 @@ export function textWysiwyg({ if (event.key === KEYS.ESCAPE) { event.preventDefault(); handleSubmit(); - } - if ( - event.key === KEYS.ENTER && - (event.shiftKey || event[KEYS.CTRL_OR_CMD]) - ) { + } else if (event.key === KEYS.ENTER && event[KEYS.CTRL_OR_CMD]) { event.preventDefault(); if (event.isComposing || event.keyCode === 229) { return; } handleSubmit(); - } - if (event.key === KEYS.ENTER && !event.shiftKey) { + } else if (event.key === KEYS.ENTER && !event.altKey) { event.stopPropagation(); } };