react-final-form icon indicating copy to clipboard operation
react-final-form copied to clipboard

Nested forms in react 17 don't work

Open namirsab opened this issue 3 years ago • 1 comments
trafficstars

Are you submitting a bug report or a feature request?

Bug

What is the current behavior?

With React 17, nested forms don't work if they are nested in the dom tree. You can see this little example, the inner form triggers a page reload because it's actually submitting the form. https://codesandbox.io/s/react-final-form-simple-example-forked-w4vifm

What is the expected behavior?

In React 16, this was working as expected. The inner form was submitted when the inner submit button was clicked.

Sandbox Link

https://codesandbox.io/s/react-final-form-simple-example-forked-w4vifm

namirsab avatar Mar 03 '22 12:03 namirsab

Any news on this?

NathanCFoster avatar Jul 13 '22 15:07 NathanCFoster

There won't be news because <form> elements can't be nested as per spec.

GabenGar avatar Nov 08 '22 15:11 GabenGar

any news ?

andrewAtalent avatar Dec 06 '22 18:12 andrewAtalent

Any news on this?

RadzivilVlad avatar Dec 06 '22 18:12 RadzivilVlad

As GabenGar correctly states form elements are not allowed to be nested. You probably need to implement it as a Wizard form see (https://codesandbox.io/s/github/final-form/react-final-form/tree/master/examples/wizard).

gertdreyer avatar Jan 11 '23 14:01 gertdreyer