1

I have a simple example where for some reason form stops calling onSubmit callback if I add more than one text inputs and push 'Enter' key while one of the inputs is focused.

Here is a link on CodePen: https://codepen.io/anon/pen/KePXOj?&editors=001.

This one works:

<Form onSubmit={(e)=>{e.preventDefault(); console.log(e)}}>
    <Input/>
</Form>

And this doesn't:

<Form onSubmit={(e)=>{e.preventDefault(); console.log(e)}}>
    <Input/>
    <Input/>
</Form>

What am I doing wrong there?

Sergei Basharov
  • 51,276
  • 73
  • 200
  • 335

1 Answers1

0

This doesn't seem to be an antd issue, it is a known quirk that forms with only a single input fire onsubmit when pressing enter while if they have multiple inputs they do not.

This might be related

supra28
  • 1,646
  • 10
  • 17