Skip to content

omitExtraData incorrectly removes enum objects #4784

@filbertteo

Description

@filbertteo

Prerequisites

What theme are you using?

core

Version

v6.0.0-beta.18

Current Behavior

With the omitExtraData prop set to true, RJSF removes enum objects from the form data. This will also cause validation to fail for required fields.

Expected Behavior

With the omitExtraData prop set to true, RJSF does not remove enum objects from the form data.

Steps To Reproduce

  1. Visit the playground link
  2. Click the submit button
  3. Notice that validation fails even though the location field has a value.
  4. Update the JSON schema to remove the required fields. Click the submit button.
  5. Notice that the form successfully submits.
    1. However, if you check the submitted formData in the console log, the location field is missing.
    2. Also notice that the location field in the form is now empty after the form is submitted.

Environment

N/A

Anything else?

Playground link

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions