|
|
@ -33,6 +33,10 @@ const messages = defineMessages({ |
|
|
|
export default @injectIntl |
|
|
|
export default @injectIntl |
|
|
|
class ComposeForm extends ImmutablePureComponent { |
|
|
|
class ComposeForm extends ImmutablePureComponent { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setRef = c => { |
|
|
|
|
|
|
|
this.composeForm = c; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static contextTypes = { |
|
|
|
static contextTypes = { |
|
|
|
router: PropTypes.object, |
|
|
|
router: PropTypes.object, |
|
|
|
}; |
|
|
|
}; |
|
|
@ -114,6 +118,10 @@ class ComposeForm extends ImmutablePureComponent { |
|
|
|
this.props.onChangeSpoilerText(e.target.value); |
|
|
|
this.props.onChangeSpoilerText(e.target.value); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleFocus = () => { |
|
|
|
|
|
|
|
this.composeForm.scrollIntoView(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate (prevProps) { |
|
|
|
componentDidUpdate (prevProps) { |
|
|
|
// This statement does several things:
|
|
|
|
// This statement does several things:
|
|
|
|
// - If we're beginning a reply, and,
|
|
|
|
// - If we're beginning a reply, and,
|
|
|
@ -177,7 +185,7 @@ class ComposeForm extends ImmutablePureComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className='compose-form'> |
|
|
|
<div className='compose-form' ref={this.setRef}> |
|
|
|
<WarningContainer /> |
|
|
|
<WarningContainer /> |
|
|
|
|
|
|
|
|
|
|
|
<ReplyIndicatorContainer /> |
|
|
|
<ReplyIndicatorContainer /> |
|
|
@ -211,6 +219,7 @@ class ComposeForm extends ImmutablePureComponent { |
|
|
|
value={this.props.text} |
|
|
|
value={this.props.text} |
|
|
|
onChange={this.handleChange} |
|
|
|
onChange={this.handleChange} |
|
|
|
suggestions={this.props.suggestions} |
|
|
|
suggestions={this.props.suggestions} |
|
|
|
|
|
|
|
onFocus={this.handleFocus} |
|
|
|
onKeyDown={this.handleKeyDown} |
|
|
|
onKeyDown={this.handleKeyDown} |
|
|
|
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested} |
|
|
|
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested} |
|
|
|
onSuggestionsClearRequested={this.onSuggestionsClearRequested} |
|
|
|
onSuggestionsClearRequested={this.onSuggestionsClearRequested} |
|
|
|