0
0
Fork 0

Merge branch 'master' into glitch-soc/merge-upstream

Conflicts:
- app/controllers/statuses_controller.rb
- app/controllers/stream_entries_controller.rb
This commit is contained in:
Thibaut Girka 2019-06-07 17:00:36 +02:00
commit 34b8346e7f
63 changed files with 239 additions and 535 deletions

View file

@ -34,6 +34,10 @@ const messages = defineMessages({
export default @injectIntl
class ComposeForm extends ImmutablePureComponent {
setRef = c => {
this.composeForm = c;
};
static contextTypes = {
router: PropTypes.object,
};
@ -115,6 +119,10 @@ class ComposeForm extends ImmutablePureComponent {
this.props.onChangeSpoilerText(e.target.value);
}
handleFocus = () => {
this.composeForm.scrollIntoView();
}
componentDidUpdate (prevProps) {
// This statement does several things:
// - If we're beginning a reply, and,
@ -178,7 +186,7 @@ class ComposeForm extends ImmutablePureComponent {
}
return (
<div className='compose-form'>
<div className='compose-form' ref={this.setRef}>
<WarningContainer />
<ReplyIndicatorContainer />
@ -201,7 +209,7 @@ class ComposeForm extends ImmutablePureComponent {
/>
</div>
<div className='emoji-picker-wrapper'>
<div className={`emoji-picker-wrapper ${this.props.showSearch ? 'emoji-picker-wrapper--hidden' : ''}`}>
<EmojiPickerDropdown onPickEmoji={this.handleEmojiPick} />
</div>
@ -212,6 +220,7 @@ class ComposeForm extends ImmutablePureComponent {
value={this.props.text}
onChange={this.handleChange}
suggestions={this.props.suggestions}
onFocus={this.handleFocus}
onKeyDown={this.handleKeyDown}
onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
onSuggestionsClearRequested={this.onSuggestionsClearRequested}