React-admin: submitOnEnter not working

Created on 30 Apr 2018  路  5Comments  路  Source: marmelab/react-admin

submitOnEnter={false} does not work, form submits anyway.

What you were expecting:
Form not to submit.

What happened instead:
Form submits - acts like html form with method="get" - copies form parameter to url query for some reason.

Steps to reproduce:
create very standard component as in related code below

Related code:

export const UserEdit = (props) => (
    <Edit {...props}>
        <SimpleForm submitOnEnter={false}>
            <TextInput source="userName"/>
        </SimpleForm>
    </Edit>
);

Other information:

Environment

  • React-admin version: v2.0.0-RC2
  • Last version that did not exhibit the issue (if applicable): didn't checked
  • React version: 16.3.2
  • Browser: Chrome 66
  • Stack trace (in case of a JS error): none
bug

Most helpful comment

It is not fixed by #2064, since the PR is not merged. I have the same issue in my SimpleForm and used the action="javascript: void(0)" hack to avoid this behavior. Please reopen the issue.

All 5 comments

I managed to reproduce it for some forms but not all. See https://codesandbox.io/s/73l4oqv1l6

PostCreate which uses SimpleForm shows the problem. You can submit with enter when submitOnEnter is false.

PostEdit which uses TabbedForm does not show the problem.

CommentCreate which uses SimpleForm does not show the problem.

CommentEdit which uses SimpleForm does not show the problem.

@djhi does #2032 fix that?

Nope

Fixed by #2064

It is not fixed by #2064, since the PR is not merged. I have the same issue in my SimpleForm and used the action="javascript: void(0)" hack to avoid this behavior. Please reopen the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nicgirault picture nicgirault  路  3Comments

alukito picture alukito  路  3Comments

marknelissen picture marknelissen  路  3Comments

pixelscripter picture pixelscripter  路  3Comments

ilaif picture ilaif  路  3Comments