-
Notifications
You must be signed in to change notification settings - Fork 10
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
NumberMask: erroneous behavior when using allowEmpty with initialValues #37
Comments
This returns an empty string for the normalize function if |
@mitchvoll There's more information here: redux-form/redux-form#3946 (comment). I think the only way to really solve this for the current version of |
🎉 This issue has been resolved in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What are you reporting?
What is the current behavior?
When a
Field
which has an initial value is using a number mask with theallowEmpty
option set, it is not possible to set the input value to zero. Also, in this case, instead of setting theField
's value toundefined
, it sets to an empty string.What is the expected behavior?
We should be able to set the
Field
to0
in this case and the value when the input is empty should beundefined
ornull
.Sandbox Link
https://codesandbox.io/s/n4k073xzj
What's your environment?
Other information
This is related to redux-form/redux-form#3946. The only viable way to fix it is changing may be changing the
normalize
's return tonull
forallowEmpty
(which makes more sense to me), but this may be a breaking change.The text was updated successfully, but these errors were encountered: