Open
Description
Version Number
7.43.2
Codesandbox/Expo snack
https://codesandbox.io/s/snowy-https-hnyckh?file=/src/App.tsx
Steps to reproduce
- Go to https://codesandbox.io/s/snowy-https-hnyckh?file=/src/App.tsx
- Click on 'Show modal'
- Enter an e-mail address in the modal form
- Click the 'Submit' button on the modal
- Observe that the outer form submit count increases and its onSubmit handler is called.
Expected behaviour
The outer form should not be submitted as the Modal
component calls event.stopPropagation()
in the callback passed to handleSubmit
.
What browsers are you seeing the problem on?
Chrome
Relevant log output
in <Modal /> onSubmit:
{email: "foo@example.com"}
in top form onSubmit:
{email: "", firstName: ""}
Code of Conduct
- I agree to follow this project's Code of Conduct