From 980d08ce56e2eb7eaf03e3a6a5ccb13b410bbfcc Mon Sep 17 00:00:00 2001 From: alaoui abdellah Date: Fri, 3 Apr 2020 13:41:32 +0100 Subject: [PATCH] Add support for committing a text entry on cmd/shift click (#1185) --- src/element/textWysiwyg.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/element/textWysiwyg.tsx b/src/element/textWysiwyg.tsx index 22e6c041..d1134e45 100644 --- a/src/element/textWysiwyg.tsx +++ b/src/element/textWysiwyg.tsx @@ -109,6 +109,13 @@ export function textWysiwyg({ ev.preventDefault(); handleSubmit(); } + if (ev.key === KEYS.ENTER && (ev.shiftKey || ev.metaKey)) { + ev.preventDefault(); + if (ev.isComposing || ev.keyCode === 229) { + return; + } + handleSubmit(); + } if (ev.key === KEYS.ENTER && !ev.shiftKey) { ev.stopPropagation(); }