-
Notifications
You must be signed in to change notification settings - Fork 6.7k
The datepicker's date-disabled
validation error does not conform to angular validation error standards, and requires awkward syntax to react to on the front-end.
#3439
Comments
What is the reason for setting disabled control to invalid? I would like to see it fixed. |
Also observed this error. It messes with my form validation. |
This seems like a bug. The control adds |
@Asvarduil @wesleycho @BobbieBarker This issue should be fixed with PR #3606. There hasn't been any activity on it in over a month though so I'm not sure when they plan on pulling it in. |
It appears this is already fixed - the validation key is now |
@wesleycho It appears that the validation key is in there correctly now, however it still doesn't have the expected behavior. In the plunker above, if you change it to use the latest angular.js (1.4.7) and latest ui-bootstrap (14.3) you still can't get the validation message to pop up if you manually type in a date outside of the range. The only time I can see the dateDisabled error show up in the $errors array is if you have an invalid date typed in, then open up the datepicker popup. |
@willisd2 I've found that if you've opened the datepicker once, it'll show up, so open it, close it, and the validator seems attached. I find it weird that the validation error is not on the field itself, only on the form $error array... |
@willisd2 Yeah I'm having that problem now. The form is loading up with an illegal value but isn't mark as valid until I pop open the datepicker popup. Is there a way to auto digest the validation? |
Why is this closed? The issue doesn't seem to be resolved. |
Reproduction Plunker can be found here
Steps to Reproduce:
Open the reproduction plunker given above.
Observe that the
testText
control has a min-date of 1/2/2000 and max-date attribute of 12/31/2099.Enter a value outside of the min/max date range (e.g. 1/1/1900 or 1/1/2100)
Observe that both the form-level and control-level validation messages use the syntax,
testform.$error['date-disabled']
andtestForm.testText.$error['date-disabled']
In the "Form Error Dictionary Blob" section, observe that the JSON blob has
date-disabled
as the key.Observed Behavior:
It's necessary to use
testform.$error['date-disabled']
ortestForm.testText.$error['date-disabled']
to access the error object for a date being outside of the min/max-date range.Expected Behavior:
I should be able to use the fluent syntax,
testForm.$error.dateDisabled
ortestForm.testText.$error.dateDisabled
when interacting with thedateDisabled
validation error on the front end.The text was updated successfully, but these errors were encountered: