diff --git a/app/javascript/gabsocial/features/compose/components/compose_form.js b/app/javascript/gabsocial/features/compose/components/compose_form.js index 6d8625e5..8f595904 100644 --- a/app/javascript/gabsocial/features/compose/components/compose_form.js +++ b/app/javascript/gabsocial/features/compose/components/compose_form.js @@ -68,6 +68,7 @@ class ComposeForm extends ImmutablePureComponent { anyMedia: PropTypes.bool, shouldCondense: PropTypes.bool, autoFocus: PropTypes.bool, + isModalOpen: PropTypes.bool, }; static defaultProps = { @@ -150,6 +151,8 @@ class ComposeForm extends ImmutablePureComponent { } componentDidUpdate (prevProps) { + if (!this.autosuggestTextarea) return; + // This statement does several things: // - If we're beginning a reply, and, // - Replying to zero or one users, places the cursor at the end of the textbox. @@ -203,7 +206,7 @@ class ComposeForm extends ImmutablePureComponent { } render () { - const { intl, onPaste, showSearch, anyMedia, shouldCondense, autoFocus } = this.props; + const { intl, onPaste, showSearch, anyMedia, shouldCondense, autoFocus, isModalOpen } = this.props; const condensed = shouldCondense && !this.props.text && !this.state.composeFocused; const disabled = this.props.isSubmitting; const text = [this.props.spoilerText, countableText(this.props.text)].join(''); @@ -252,7 +255,7 @@ class ComposeForm extends ImmutablePureComponent { ({ isUploading: state.getIn(['compose', 'is_uploading']), showSearch: state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']), anyMedia: state.getIn(['compose', 'media_attachments']).size > 0, + isModalOpen: state.get('modal').modalType === 'COMPOSE', }); const mapDispatchToProps = (dispatch) => ({