forked from treehouse/mastodon
Fix some React warnings (#10989)
parent
560ec24e58
commit
cc8f6b3cda
|
@ -201,7 +201,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
<div className='compose-form__autosuggest-wrapper'>
|
<div className='compose-form__autosuggest-wrapper' key='autosuggest-wrapper'>
|
||||||
<div className='autosuggest-textarea'>
|
<div className='autosuggest-textarea'>
|
||||||
<label>
|
<label>
|
||||||
<span style={{ display: 'none' }}>{placeholder}</span>
|
<span style={{ display: 'none' }}>{placeholder}</span>
|
||||||
|
@ -226,7 +226,8 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
</div>
|
</div>
|
||||||
{children}
|
{children}
|
||||||
</div>,
|
</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'}`}>
|
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
|
||||||
{suggestions.map(this.renderSuggestion)}
|
{suggestions.map(this.renderSuggestion)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -33,10 +33,6 @@ 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,
|
||||||
};
|
};
|
||||||
|
@ -119,7 +115,9 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleFocus = () => {
|
handleFocus = () => {
|
||||||
this.composeForm.scrollIntoView();
|
if (this.composeForm) {
|
||||||
|
this.composeForm.scrollIntoView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate (prevProps) {
|
componentDidUpdate (prevProps) {
|
||||||
|
@ -163,6 +161,10 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
this.spoilerText = c;
|
this.spoilerText = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setRef = c => {
|
||||||
|
this.composeForm = c;
|
||||||
|
};
|
||||||
|
|
||||||
handleEmojiPick = (data) => {
|
handleEmojiPick = (data) => {
|
||||||
const { text } = this.props;
|
const { text } = this.props;
|
||||||
const position = this.autosuggestTextarea.textarea.selectionStart;
|
const position = this.autosuggestTextarea.textarea.selectionStart;
|
||||||
|
|
Loading…
Reference in New Issue