diff --git a/src/components/TextInputFocusable/index.js b/src/components/TextInputFocusable/index.js index 4d6b53df4d9c3..bf0dfebb8ddd9 100644 --- a/src/components/TextInputFocusable/index.js +++ b/src/components/TextInputFocusable/index.js @@ -43,8 +43,6 @@ class TextInputFocusable extends React.Component { } componentDidUpdate(prevProps) { - this.focusInput(); - if (prevProps.defaultValue !== this.props.defaultValue) { this.updateNumberOfLines(); } diff --git a/src/page/home/report/ReportActionCompose.js b/src/page/home/report/ReportActionCompose.js index cf1650647d197..d7c76e4fbba51 100644 --- a/src/page/home/report/ReportActionCompose.js +++ b/src/page/home/report/ReportActionCompose.js @@ -36,7 +36,9 @@ class ReportActionCompose extends React.Component { this.triggerSubmitShortcut = this.triggerSubmitShortcut.bind(this); this.submitForm = this.submitForm.bind(this); this.showAttachmentPicker = this.showAttachmentPicker.bind(this); + this.setIsFocused = this.setIsFocused.bind(this); this.comment = ''; + this.state = {isFocused: false}; } componentDidUpdate(prevProps) { @@ -47,6 +49,15 @@ class ReportActionCompose extends React.Component { } } + /** + * Updates the Highlight state of the composer + * + * @param {boolean} shouldHighlight + */ + setIsFocused(shouldHighlight) { + this.setState({isFocused: shouldHighlight}); + } + /** * Save our report comment in Ion. We debounce this method in the constructor so that it's not called too often * to update Ion and re-render this component. @@ -138,7 +149,12 @@ class ReportActionCompose extends React.Component { render() { return ( - + this.setIsFocused(true)} + onBlur={() => this.setIsFocused(false)} />