fixed long Text, submit it only focused field, update value on paste

This commit is contained in:
shams mosowi
2019-10-03 15:35:28 +10:00
parent c1dbd89eec
commit 54d42ed34f

View File

@@ -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);
}}
/>