-
-
Notifications
You must be signed in to change notification settings - Fork 248
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
Typed NumberMask returns 0 when input is emptied #432
Comments
We also struggled with this. I see 2 possible solutions:
|
I had the same issue. Form validation seems broken to the user if empty == 0. This is how I solved it (based on the solution to another issue I had in #236)
Maybe it could be a new |
Hello, However, in the case of unmask = "typed", the value 0 is not returned to the input if it is empty :( example: |
Thanks for the workaround, appreciate it <3 |
How can i use NullableMaskedNumber without creating a object manually on each input? |
Hi!
I'm using
angular-imask@6.0.5
, and I see that usingunmask="typed"
onNumberMask
returns0
when targetinput
is emptied. I understand this is desired behavior, however it can lead to 2 issuesrequired
, with its internal value set to0
, the input is then considered "valid" even though it's visually empty.0
by the end user.I would therefore suggest to either return
''
,null
orundefined
instead of0
:I can work around this problem using
[unmask]="true"
and manually handling conversion betweenstring
andnumber
, but I believe it could be nice to have this by default with typed unmasking.What do you think?
The text was updated successfully, but these errors were encountered: