For an input type="number", Chrome still allows the user to enter arbitrary 
characters, but trying to get the inputs value just returns an empty string.
That means if the input is not "required", then the user can enter "ten" 
for a numeric, field, submit it, and the server just treats the value as 
missing.

For example, enter "ten" in this input field: 
http://plnkr.co/edit/opyefVqQC8l3O20CLVka?p=preview
Angular thinks the value is still valid.

After reading
http://www.w3.org/html/wg/drafts/html/master/forms.html#number-state-%28type=number%29
I guess this behaviour is compliant, but still it's a usability bug.
At the minimum we would need an addition element property like "rawValue" 
to run proper validations.

Probably the best way to handle this right now, is _not_ to use input 
type="number", but write a custom directive, that uses type="text" and that 
does the value conversion and validation itself (and optionally also adds 
spinners implemented in JS).
Any other ideas?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to