Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use onSubmitActions in a submit function without using onSubmitKey #13

Open
fnduister opened this issue Jun 12, 2017 · 0 comments

Comments

@fnduister
Copy link

I'm trying to create a button-less form.
The problem is that I can't figure out how to use the onSubmitActions function provided by this library directly in the form.
Cause I need to use event.preventDefault so that my form could be submitted.

const EditInput = ({ id, handleSubmit, toggleEditAction, editTodoAction }) => {
  const submit = () => {
    event.preventDefault();
    onSubmitActions('EDIT_TODO_FORM');
    toggleEditAction(id);
  };
  return (
    <form onSubmit={handleSubmit(submit)} onBlur={() => { toggleEditAction(id); }} >
      <Field
        name="text"
        label="What do you wanna ext man"
        type="text"
        component={renderInput}
      />
    </form>);
};

this code does not launch the FORM_SUBMIT and i don't know why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant