Skip to content
Snippets Groups Projects
Commit 6a895e1a authored by Emelia Smith's avatar Emelia Smith Committed by Eugen Rochko
Browse files

Fix: Prevent submission using same logic as submit button disabling. (#6993)

This prevents submission through ctrl/cmd+enter when the submit button is disabled.
parent 993ce0e5
No related branches found
No related tags found
No related merge requests found
......@@ -74,6 +74,14 @@ export default class ComposeForm extends ImmutablePureComponent {
this.props.onChange(this.autosuggestTextarea.textarea.value);
}
// Submit disabled:
const { is_submitting, is_uploading, anyMedia } = this.props;
const fulltext = [this.props.spoiler_text, countableText(this.props.text)].join('');
if (is_submitting || is_uploading || length(fulltext) > 500 || (fulltext.length !== 0 && fulltext.trim().length === 0 && !anyMedia)) {
return;
}
this.props.onSubmit();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment