Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radio button remains dirty after submit because initialValue does not update to newly saved value despite initialValue prop changing #988

Open
cachemap opened this issue Apr 29, 2022 · 0 comments

Comments

@cachemap
Copy link

cachemap commented Apr 29, 2022

Are you submitting a bug report or a feature request?

Bug Report

What is the current behavior?

Submitting a form with 2 radio button <Field>s results in the radio button state being considered "dirty" after submit succeeds. The form's initialValues shows the old/previous value despite the initialValue prop on both radio button <Field>s being changed after the submit completes.

What is the expected behavior?

Given an initial form state of:

{ section-one: { radio-button: "A" } }

Given radio buttons initialized like so:
A) (selected)
B)

And a change by the user to:

A)
B) (selected)

Upon clicking "Submit", B would remain as the selected radio button, and the form's dirty state would be false because section-one.radio-button would not be considered dirty.

(Currently, it would be considered dirty because the initial[name] would show as being the "old" value instead of the newly saved one.)

Sandbox Link

(Coming soon, hopefully!)

What's your environment?

[email protected]
[email protected]
Windows 10

Other information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant