-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Input date throws required when date is invalid #8374
Comments
@kox this is the same issue we have with So what happens is: certain input types have a state in the HTML spec where they are "suffering from bad input". When suffering from bad input, these controls report their value to us as empty. So, Example: So, what we need to do is enable native validators (which are already enabled for numbers) for dates, and also make sure that required validation is not run unless they are not suffering from bad input. Both of these things are being worked on, but I think for now we can mark this issue as a dupe of some other issues regarding this |
AND PS, yes I've spoken with Hixie about this, I think it's a really dumb behaviour of HTML, but I guess I haven't made my case very clearly, and it's a bit late now since vendors are already shipping this broken validation API --- but you can read all about it at http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html |
Thank you @caitp for your help and sorry for dupe. |
Issue reopened since the cause for this issue is related to other open issues, but the manifestation/behavior is slightly different, and should be accounted for in tests. |
This is fixed in master. Due to how validation is handled in 1.2.x I don't think it'll be fixed there. |
1.2.x does not support input[type=date] anyways |
When I implement an input date as required and I insert an invalid date like 4/31/1996, then the validation throws a ng-invalid-required but in the documentation the invalid dates are triggered as $error.date:
How is possible to detect when a date is invalid or when was not inserted?
The text was updated successfully, but these errors were encountered: