Skip to content

Commit

Permalink
feat(replyform): Avoid flash of enabled Post button (#565)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Conrad Chan and mergify[bot] authored Aug 28, 2020
1 parent 4f3a718 commit 84dd440
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/ReplyForm/ReplyFormContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export const mapStateToProps = (state: AppState): PropsFromState => ({
isCurrentFileVersion: getIsCurrentFileVersion(state),
});

export const mapPropsToErrors = (): FormErrors => ({ editorState: 'initial' });

export const mapPropsToValues = ({ cursorPosition: prevCursorPosition, value = '' }: Props): FormValues => {
const mentionState = withMentionDecorator(createMentionSelectorState(value));
const cursorPosition = value ? prevCursorPosition : 0;
Expand Down Expand Up @@ -70,6 +72,7 @@ export const handleSubmit = (
const ReplyFormContainer = connect(mapStateToProps)(
withFormik<Props, FormValues>({
handleSubmit,
mapPropsToErrors,
mapPropsToValues,
validate,
validateOnMount: true,
Expand Down

0 comments on commit 84dd440

Please sign in to comment.