-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bug: Cannot set currency field value to null
if the value was set to 0.0
before
#9
Comments
@doefom possible that you had a |
@caseydwyer yes, I indeed had a default value on the field. However, the default was not |
Hmmm...possibly, that's kinda weird and I don't have an explanation for exactly what you're seeing, there, with it using a different value. That's probably worth looking into. But I'm not able to reproduce this without a |
Yeah, so that ☝ is definitely playing a role, here...but there's something unique/specific to having |
Yep, confirmed it's in the Vue component—and more specifically, it has something to do with the masking library you've got in that component. When I remove it (ie, temporarily delete all the Clearing the field from any non-zero number works exactly as expected (ie, based on the way Statamic handles default values; see above link). It's only when you're going from |
Thanks for looking into it! Had a feeling it might be related to the input mask we're using. Will try to fix the issue when deleting the |
Description
Setting the currency field value to
null
doesn't work if the value was previously set to0.0
. This can be problematic as users may want to nullify or reset the field value, but they are unable to do so. However, nullifying any other value works as expected.Further information
Debugging showed that the
process
method does receive the value"0.00"
instead ofnull
after nullifying the field when the value was set to0.0
before. This issue might be related to the use of an input mask.Steps to reproduce
0.0
and save the entry.null
afterwards and hit save.0.0
.Expected behavior
When the user sets the value to
null
the field value should reflect thenull
value.Actual behavior
The currency field value remains
0.0
and doesn't allow for nullification.The text was updated successfully, but these errors were encountered: