mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 05:09:04 +01:00
Fix some React warnings (#10989)
This commit is contained in:
parent
560ec24e58
commit
cc8f6b3cda
2 changed files with 10 additions and 7 deletions
|
@ -201,7 +201,7 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
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>
|
||||
|
@ -226,7 +226,8 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
</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>
|
||||
|
|
|
@ -33,10 +33,6 @@ const messages = defineMessages({
|
|||
export default @injectIntl
|
||||
class ComposeForm extends ImmutablePureComponent {
|
||||
|
||||
setRef = c => {
|
||||
this.composeForm = c;
|
||||
};
|
||||
|
||||
static contextTypes = {
|
||||
router: PropTypes.object,
|
||||
};
|
||||
|
@ -119,8 +115,10 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
handleFocus = () => {
|
||||
if (this.composeForm) {
|
||||
this.composeForm.scrollIntoView();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate (prevProps) {
|
||||
// This statement does several things:
|
||||
|
@ -163,6 +161,10 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
this.spoilerText = c;
|
||||
}
|
||||
|
||||
setRef = c => {
|
||||
this.composeForm = c;
|
||||
};
|
||||
|
||||
handleEmojiPick = (data) => {
|
||||
const { text } = this.props;
|
||||
const position = this.autosuggestTextarea.textarea.selectionStart;
|
||||
|
|
Loading…
Reference in a new issue