Skip to content

keepDirtyOnReinitialize can't handle undefined value #449

@mjchang

Description

@mjchang

Are you submitting a bug report or a feature request?

Bug report

What is the current behavior?

If keepDirtyOnReinitialize is true, when a field is changed from its initial value to undefined, the initialize logic will set formState.values to undefined which causes the form to crash.

What is the expected behavior?

formState.values should never become undefined. If a field's value is changed to undefined, the key should be removed from formState.values.

Sandbox Link

What's your environment?

final-form 4.20.6
react-final-form 6.5.8
node 16

Other information

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