You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 29, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on May 29, 2019. It is now read-only.
No possibility of using invalid values with Datepicker #6054
No possibility to set invalid Datepicker values (to display inside input field),
even if ng-model-options="{allowInvalid: true}".
As I suppose Timepicker bahaviour is the same.
If validation of entered value is so strict, should be easy possibility to override it.
Link to minimally-working plunker that reproduces the issue:
As for adding baked in support from model changes, I'm leaning towards rejecting this request - IMO this is a perversion of what that option was created for in Angular. In addition, this likely would have unintended consequences with the datepicker and popup that could potentially break the datepicker.
I would be willing to potentially support a PR that adds support for this using a different option unique to the popup, but it also needs to be well-tested along with a reproduction in Plunker demonstrating it works properly.
User reloads form, date string is hidden, although still in model (which means it can't be reviewed or corrected)
Seems like a very common use case that is completely broken right now, and allowInvalid on any standard form control would behave in a way that doesn't break it. Special-casing the setting, unless there is an unmanageable technical issue, seems like a strange choice.
Activity
wesleycho commentedon Jun 27, 2016
The allowInvalid setting is for changes started from a view, not from a model (see how Angular uses allowInvalid here: https://github.com/angular/angular.js/blob/master/src/ng/directive/ngModel.js). You would need to attach a custom directive and execute
ngModel.$setViewValue(customValue).As for adding baked in support from model changes, I'm leaning towards rejecting this request - IMO this is a perversion of what that option was created for in Angular. In addition, this likely would have unintended consequences with the datepicker and popup that could potentially break the datepicker.
I would be willing to potentially support a PR that adds support for this using a different option unique to the popup, but it also needs to be well-tested along with a reproduction in Plunker demonstrating it works properly.
npbenjohnson commentedon Apr 14, 2017
Seems like a very common use case that is completely broken right now, and allowInvalid on any standard form control would behave in a way that doesn't break it. Special-casing the setting, unless there is an unmanageable technical issue, seems like a strange choice.
fix(datepickerPopup): support ngModelOptions.allowInvalid angular-ui#…