uhlryk / angular-dynamic-number

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

When user types minus model assumes 0 #46

Closed leonardobh closed 7 years ago

leonardobh commented 7 years ago

If user types minus on an input that accepts so, model is automatically assigned zero, what causes the field to be valid even tough it only shows a minus character on the screen. Shouldn't only minus keep model undefined, so it would be invalid for instance?

It looks like directiveParser (line 349) returns zero even if its only a minus symbol.

uhlryk commented 7 years ago

I will consider this. I think you have a right. If so I will change it as soon as possible.

uhlryk commented 7 years ago

It will be fixed. Now it is on branch return-null. After few days if everything working as expected I will merge it to master. (If you wish check it/test it/use it you can update your installation to use branch)

marco24690 commented 3 years ago

Still not working for me. Typing only minus symbol in a required input make the field valid

Version 2.5.1