Skip to content

issue: event.stopPropagation() does not work in callback passed to handleSubmit  #916

Open
@c-t-k

Description

@c-t-k

Version Number

7.43.2

Codesandbox/Expo snack

https://codesandbox.io/s/snowy-https-hnyckh?file=/src/App.tsx

Steps to reproduce

  1. Go to https://codesandbox.io/s/snowy-https-hnyckh?file=/src/App.tsx
  2. Click on 'Show modal'
  3. Enter an e-mail address in the modal form
  4. Click the 'Submit' button on the modal
  5. 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: "[email protected]"}
in top form onSubmit: 
{email: "", firstName: ""}

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions