diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index cafee70c3b85..8a0d1726b57a 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -149,6 +149,7 @@ class ReportActionCompose extends React.Component { this.focus(false); }); + this.updateComment(this.comment); } componentDidUpdate(prevProps) { @@ -307,7 +308,7 @@ class ReportActionCompose extends React.Component { updateComment(newComment) { this.textInput.setNativeProps({text: newComment}); this.setState({ - isCommentEmpty: newComment.length === 0, + isCommentEmpty: newComment.trim().length === 0, }); // Indicate that draft has been created. @@ -345,8 +346,8 @@ class ReportActionCompose extends React.Component { this.submitForm(); } - // Trigger the edit box for last sent message if ArrowUp is pressed - if (e.key === 'ArrowUp' && this.state.isCommentEmpty) { + // Trigger the edit box for last sent message if ArrowUp is pressed and the comment is empty + if (e.key === 'ArrowUp' && this.textInput.selectionStart === 0 && this.state.isCommentEmpty) { e.preventDefault(); const reportActionKey = _.find(