Merge tag 'v4.0.2'
This commit is contained in:
commit
b0fa7842db
1563 changed files with 59605 additions and 38210 deletions
|
|
@ -93,7 +93,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > 500 || (isOnlyWhitespace && !anyMedia));
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
handleSubmit = (e) => {
|
||||
if (this.props.text !== this.autosuggestTextarea.textarea.value) {
|
||||
// Something changed the text inside the textarea (e.g. browser extensions like Grammarly)
|
||||
// Update the state to match the current text
|
||||
|
|
@ -105,6 +105,10 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
this.props.onSubmit(this.context.router ? this.context.router.history : null);
|
||||
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
onSuggestionsClearRequested = () => {
|
||||
|
|
@ -217,7 +221,7 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className='compose-form'>
|
||||
<form className='compose-form' onSubmit={this.handleSubmit}>
|
||||
<WarningContainer />
|
||||
|
||||
<ReplyIndicatorContainer />
|
||||
|
|
@ -279,10 +283,15 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
|
||||
<div className='compose-form__publish'>
|
||||
<div className='compose-form__publish-button-wrapper'>
|
||||
<Button text={publishText} onClick={this.handleSubmit} disabled={!this.canSubmit()} block />
|
||||
<Button
|
||||
type='submit'
|
||||
text={publishText}
|
||||
disabled={!this.canSubmit()}
|
||||
block
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue