final-form / react-final-form

🏁 High performance subscription-based form state management for React
https://final-form.org/react
MIT License
7.39k stars 481 forks source link

formatOnBlur is also updating the value in the form state #383

Open bhavathi opened 5 years ago

bhavathi commented 5 years ago

Are you submitting a bug report or a feature request?

bug report

What is the current behavior?

When formatOnBlur is used the value of that field is also updated in the form state in the format which is passed to field.

What is the expected behavior?

It should just format the value to display in the field, should not update on form state

What's your environment?

react-final-form: 3.6.5 Chrome browser node: v10.5.0

Other information

https://codesandbox.io/s/zwk325kl type any number in the price field and see the form values on blur of the field

changLiuUNSW commented 5 years ago

I have the same issue. In my case, the validation will fail because it updates the value in the form state

Filson14 commented 5 years ago

I came across this problem too. Any updates/workarounds?

fzaninotto commented 3 years ago

Bump, this bug is really unexpected, and impossible to work around.

nkappler commented 2 years ago

any updates on this? This is a really annoying bug :disappointed: