uhlryk / angular-dynamic-number

Highly customizable angular directive for numbers
64 stars 32 forks source link

On the function convModelToView changed the return of the validation from 0 to ''. #50

Closed gscavalcante closed 2 years ago

gscavalcante commented 7 years ago

In my project I needed to validate the field, but if the user press a letter or invalid character the text field becomes zero, but zero is valid number for my problem. So I changed this validation to continue an invalid field.

uhlryk commented 7 years ago

Thank you very much for your feedback. Unfortunately your pull request doesn't cover all cases. It is because this module is poorly written, there is hundreds of edge cases and after discovery each edge case there was change added. When I have those number of edge cases it need some better patterns but I don't have time to rewrite it.

I fixed problem in https://github.com/uhlryk/angular-dynamic-number/pull/52 and it is available in branch return-null. It should solve your problems. Do you want test it in branch before I merge it to production?

dkoniushenko commented 7 years ago

Hi Krzysztof, I'm trying to use your directive but have a problem. My field is not required. So it is possible to leave it empty. The fix #52 allows to do it. But it's impossible to put zero into the field. I want to have possibility to put a number, zero or leave it empty. Are you planning to add ability to put zero in your directive?