From 54d42ed34faa338f26e43043066a994701c0eb35 Mon Sep 17 00:00:00 2001 From: shams mosowi Date: Thu, 3 Oct 2019 15:35:28 +1000 Subject: [PATCH] fixed long Text, submit it only focused field, update value on paste --- src/components/Fields/LongText.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Fields/LongText.tsx b/src/components/Fields/LongText.tsx index aebe0e15..2f391ee4 100644 --- a/src/components/Fields/LongText.tsx +++ b/src/components/Fields/LongText.tsx @@ -46,7 +46,7 @@ const LongText = (props: Props) => { const open = Boolean(anchorEl); const id = open ? "no-transition-popper" : undefined; const onClickAway = (event: any) => { - if (event.target.id !== id) { + if (event.target.id !== id && open) { onSubmit(text); setAnchorEl(null); } @@ -70,7 +70,7 @@ const LongText = (props: Props) => { placeholder="enter text" defaultValue={text} autoFocus - onKeyPress={(e: any) => { + onChange={(e: any) => { setText(e.target.value); }} />