Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

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

Closed
Asvarduil opened this issue Mar 25, 2015 · 9 comments
Assignees

Comments

@Asvarduil
Copy link

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'] and testForm.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'] or testForm.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 or testForm.testText.$error.dateDisabled when interacting with the dateDisabled validation error on the front end.

@cmichal
Copy link

cmichal commented Apr 24, 2015

What is the reason for setting disabled control to invalid? I would like to see it fixed.

@Duskfall
Copy link

Duskfall commented Jul 2, 2015

Also observed this error. It messes with my form validation.

@aarosil
Copy link

aarosil commented Jul 28, 2015

This seems like a bug. The control adds date-disabled property under the forms $error object, but the actual control itself shows valid: true!

@willisd2
Copy link

@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.
PRs #3440 and #3438 are related to this.

@wesleycho wesleycho added this to the 1.0.0 milestone Oct 31, 2015
@wesleycho wesleycho assigned wesleycho and unassigned BobbieBarker Oct 31, 2015
@wesleycho wesleycho removed this from the 1.0.0 milestone Oct 31, 2015
@wesleycho
Copy link
Contributor

It appears this is already fixed - the validation key is now dateDisabled in master (may have been there for the past couple of releases.

@willisd2
Copy link

willisd2 commented Nov 2, 2015

@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.

@icorne
Copy link

icorne commented Jul 26, 2016

@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...

@IngoVals
Copy link

@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?

@ataravati
Copy link

Why is this closed? The issue doesn't seem to be resolved.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests