diff --git a/src/pages/home/report/ReportActionCompose.js b/src/pages/home/report/ReportActionCompose.js index 0813fc6df435..1616b296952e 100755 --- a/src/pages/home/report/ReportActionCompose.js +++ b/src/pages/home/report/ReportActionCompose.js @@ -145,6 +145,7 @@ class ReportActionCompose extends React.Component { end: props.comment.length, }, maxLines: props.isSmallScreenWidth ? CONST.COMPOSER.MAX_LINES_SMALL_SCREEN : CONST.COMPOSER.MAX_LINES, + value: props.comment, }; } @@ -312,9 +313,6 @@ class ReportActionCompose extends React.Component { addEmojiToTextBox(emoji) { const newComment = this.comment.slice(0, this.state.selection.start) + emoji + this.comment.slice(this.state.selection.end, this.comment.length); - this.textInput.setNativeProps({ - text: newComment, - }); this.setState(prevState => ({ selection: { start: prevState.selection.start + emoji.length, @@ -373,9 +371,9 @@ class ReportActionCompose extends React.Component { * @param {String} newComment */ updateComment(newComment) { - this.textInput.setNativeProps({text: newComment}); this.setState({ isCommentEmpty: !!newComment.match(/^(\s|`)*$/), + value: newComment, }); // Indicate that draft has been created. @@ -628,7 +626,6 @@ class ReportActionCompose extends React.Component { this.setState({isDraggingOver: false}); }} style={[styles.textInputCompose, this.props.isComposerFullSize ? styles.textInputFullCompose : styles.flex4]} - defaultValue={this.props.comment} maxLines={this.state.maxLines} onFocus={() => this.setIsFocused(true)} onBlur={() => this.setIsFocused(false)} @@ -641,6 +638,7 @@ class ReportActionCompose extends React.Component { isFullComposerAvailable={this.state.isFullComposerAvailable} setIsFullComposerAvailable={this.setIsFullComposerAvailable} isComposerFullSize={this.props.isComposerFullSize} + value={this.state.value} />