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

Move messes up pristine meta value #17

Closed
maciejmyslinski opened this issue Dec 10, 2018 · 1 comment
Closed

Move messes up pristine meta value #17

maciejmyslinski opened this issue Dec 10, 2018 · 1 comment

Comments

@maciejmyslinski
Copy link

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

We have an array of fruits.
Initial values are: ['', 'apple']

Steps to reproduce:

  • Clean Fruit #2 field (enter empty value '')
  • Click on move() button.

Fruit #1 is not pristine

What is the expected behavior?

Fruit #1 field should be pristine since it equals === the initial value

Sandbox Link

Edit 🐛 move messes up pristine meta value

What's your environment?

package version
final-form 4.11
react-final-form 4.0.2
final-form-arrays 1.1.1
react-final-form-arrays 2.0.1

Other information

@erikras
Copy link
Member

erikras commented Jul 11, 2019

Gorgeous sandbox! Nice styling!

This is related to how Final Form deletes values when the field is empty.

If you provide a parse={v => v} prop to Field, it preserves the '' value and it works as expected. See below:

Edit 🐛 move messes up pristine meta value

I think this is not really a bug.

@erikras erikras closed this as completed Jul 11, 2019
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

2 participants