From 02d81a36f14a20e4cae447e6552c7e41265e9dd4 Mon Sep 17 00:00:00 2001 From: James Morris Date: Wed, 6 Jul 2022 19:41:36 +0200 Subject: [PATCH] Made unblur work on the text box when adding --- apps/comments-ui/src/components/AddForm.js | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/apps/comments-ui/src/components/AddForm.js b/apps/comments-ui/src/components/AddForm.js index 18aa2f60e7..cc76c33bcb 100644 --- a/apps/comments-ui/src/components/AddForm.js +++ b/apps/comments-ui/src/components/AddForm.js @@ -95,7 +95,7 @@ class AddForm extends React.Component { } try { - // Todo: send comment to server + // Send comment to server await this.context.onAction('addComment', { post_id: this.context.postId, status: 'published', @@ -118,7 +118,9 @@ class AddForm extends React.Component { } handleBlur(event) { - // this.setState({focused: false}); + if (this.state.message === '') { + this.setState({focused: false}); + } } handleFocus(event) { @@ -134,9 +136,24 @@ class AddForm extends React.Component {
-