}
return [
- <div className='compose-form__autosuggest-wrapper'>
+ <div className='compose-form__autosuggest-wrapper' key='autosuggest-wrapper'>
<div className='autosuggest-textarea'>
<label>
<span style={{ display: 'none' }}>{placeholder}</span>
</div>
{children}
</div>,
- <div className='autosuggest-textarea__suggestions-wrapper'>
+
+ <div className='autosuggest-textarea__suggestions-wrapper' key='suggestions-wrapper'>
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
{suggestions.map(this.renderSuggestion)}
</div>
export default @injectIntl
class ComposeForm extends ImmutablePureComponent {
- setRef = c => {
- this.composeForm = c;
- };
-
static contextTypes = {
router: PropTypes.object,
};
}
handleFocus = () => {
- this.composeForm.scrollIntoView();
+ if (this.composeForm) {
+ this.composeForm.scrollIntoView();
+ }
}
componentDidUpdate (prevProps) {
this.spoilerText = c;
}
+ setRef = c => {
+ this.composeForm = c;
+ };
+
handleEmojiPick = (data) => {
const { text } = this.props;
const position = this.autosuggestTextarea.textarea.selectionStart;