From db3c6214e67f76ea74c326bfd80f4909e4594479 Mon Sep 17 00:00:00 2001 From: David Frenkiel Date: Sat, 30 Apr 2022 13:01:02 -1000 Subject: [PATCH 1/2] [#7971] Disable send if only backticks/whitespace --- src/pages/home/report/ReportActionCompose.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 6b518b356c7b..88d873d75fee 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -301,7 +301,7 @@ class ReportActionCompose extends React.Component { updateComment(newComment) { this.textInput.setNativeProps({text: newComment}); this.setState({ - isCommentEmpty: newComment.trim().length === 0, + isCommentEmpty: !!newComment.match(/^(\s|`)*$/), }); // Indicate that draft has been created. From 70cf26a131a373f1552d725fc245712a51b883be Mon Sep 17 00:00:00 2001 From: David Frenkiel Date: Tue, 3 May 2022 09:37:18 -1000 Subject: [PATCH 2/2] [#7971] Disable enter key for send if only backticks/whitespace --- src/pages/home/report/ReportActionCompose.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 88d873d75fee..432131180095 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -368,7 +368,7 @@ class ReportActionCompose extends React.Component { const trimmedComment = this.comment.trim(); // Don't submit empty comments or comments that exceed the character limit - if (!trimmedComment || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) { + if (this.state.isCommentEmpty || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) { return; }