Skip to content

Commit a1dc52c

Browse files
authored
Merge pull request #8844 from frenkield/fix-7971-backticks
[#7971] Disable send if only backticks/whitespace
2 parents 569289b + 70cf26a commit a1dc52c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/home/report/ReportActionCompose.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class ReportActionCompose extends React.Component {
301301
updateComment(newComment) {
302302
this.textInput.setNativeProps({text: newComment});
303303
this.setState({
304-
isCommentEmpty: newComment.trim().length === 0,
304+
isCommentEmpty: !!newComment.match(/^(\s|`)*$/),
305305
});
306306

307307
// Indicate that draft has been created.
@@ -368,7 +368,7 @@ class ReportActionCompose extends React.Component {
368368
const trimmedComment = this.comment.trim();
369369

370370
// Don't submit empty comments or comments that exceed the character limit
371-
if (!trimmedComment || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) {
371+
if (this.state.isCommentEmpty || trimmedComment.length > CONST.MAX_COMMENT_LENGTH) {
372372
return;
373373
}
374374

0 commit comments

Comments
 (0)