Fix account note textarea being interactable before the relationship gets fetched (#34932)
This commit is contained in:
parent
a4bc438010
commit
375add0c83
2 changed files with 33 additions and 11 deletions
|
@ -8,6 +8,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
|
||||||
import Textarea from 'react-textarea-autosize';
|
import Textarea from 'react-textarea-autosize';
|
||||||
|
|
||||||
|
import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
placeholder: { id: 'account_note.placeholder', defaultMessage: 'Click to add a note' },
|
placeholder: { id: 'account_note.placeholder', defaultMessage: 'Click to add a note' },
|
||||||
});
|
});
|
||||||
|
@ -153,17 +155,23 @@ class AccountNote extends ImmutablePureComponent {
|
||||||
<FormattedMessage id='account.account_note_header' defaultMessage='Personal note' /> <InlineAlert show={saved} />
|
<FormattedMessage id='account.account_note_header' defaultMessage='Personal note' /> <InlineAlert show={saved} />
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<Textarea
|
{this.props.value === undefined ? (
|
||||||
id={`account-note-${accountId}`}
|
<div className='account__header__account-note__loading-indicator-wrapper'>
|
||||||
className='account__header__account-note__content'
|
<LoadingIndicator />
|
||||||
disabled={this.props.value === null || value === null}
|
</div>
|
||||||
placeholder={intl.formatMessage(messages.placeholder)}
|
) : (
|
||||||
value={value || ''}
|
<Textarea
|
||||||
onChange={this.handleChange}
|
id={`account-note-${accountId}`}
|
||||||
onKeyDown={this.handleKeyDown}
|
className='account__header__account-note__content'
|
||||||
onBlur={this.handleBlur}
|
disabled={value === null}
|
||||||
ref={this.setTextareaRef}
|
placeholder={intl.formatMessage(messages.placeholder)}
|
||||||
/>
|
value={value || ''}
|
||||||
|
onChange={this.handleChange}
|
||||||
|
onKeyDown={this.handleKeyDown}
|
||||||
|
onBlur={this.handleBlur}
|
||||||
|
ref={this.setTextareaRef}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8203,6 +8203,20 @@ noscript {
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
&__loading-indicator-wrapper {
|
||||||
|
position: relative;
|
||||||
|
height: 37px;
|
||||||
|
|
||||||
|
.loading-indicator {
|
||||||
|
left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.circular-progress {
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue