Skip to content

Programmatic submit does not work in React 17 #878

@MartijnHols

Description

@MartijnHols

Are you submitting a bug report or a feature request?

Bug

What is the current behavior?

Submission using form.dispatchEvent(new Event('submit', { cancelable: true })) does not work after upgrading to React 17.

Hit the
image button here to see it do nothing:

https://codesandbox.io/s/react-final-form-external-submit-button-forked-kcrsu?file=/index.js

What is the expected behavior?

It submits the form, as it did prior to React 17. You can view this behavior by changing the React version in the sandbox.

Sandbox Link

https://codesandbox.io/s/react-final-form-external-submit-button-forked-kcrsu?file=/index.js

What's your environment?

RFF 6.5.2
FF 4.20.1
React 17

Other information

Sandbox is an updated version from https://final-form.org/docs/react-final-form/faq#via-documentgetelementbyid. No other changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions