-
Notifications
You must be signed in to change notification settings - Fork 6.7k
datepicker and ngForm's $pristine state for field #855
Comments
@floyd-may could you provide a live reproduce scenario using http://plnkr.co/ ? |
Do you have a working datepicker on plunkr? If so I can create a demo of (misspelled from my mobile phone)
|
@floyd-may sure, I've just forked a plunk from the demo page (http://angular-ui.github.io/bootstrap/#/datepicker) Please change it to demonstrate your issue |
Plunk created: http://plnkr.co/edit/gGAU0L?p=preview Use the datepicker to change the date, and notice that the |
@floyd-may OK, I see. This is definitely a bug. BTW, if you can PR for this would be nice :-) |
@bekos is this something easy to fix? I'm preparing a new release so would be cool to have this one fixed. |
@pkozlowski-opensource Probably not an easy fix. Unfortunately I don't have much time to look into this one now. |
@pkozlowski-opensource @bekos I don't consider this a bug. A |
@hall5714 Strictly speaking you are right, but the line here is very thin, since the popup datepicker is somehow part of the control. People see it as selecting an option from a dropdown and thus the new value makes the control dirty. |
@bekos Good point. As for fixing it... I don't really see how at this point. Setting As far as I can tell there is no clean way to set a form to dirty or clean without |
Ignore above... it just occurred to me that the $pristine state should be changed once |
I have the same issue. When the date is selected, it should set the field dirty. So I looked into it and I'm almost certain the fix is this (using NgModelController; see http://docs.angularjs.org/api/ng.directive:ngModel.NgModelController):
However, the one problem I have is this. When It's really strange because the model (i.e. |
Apologies for the noise, but is there an expected timeline for the 0.6.0 release? |
Using the datepicker to select a date appears to be invisible to invisible to a containing ngForm's logic, leaving the field's state in the ngForm with
$pristine === true
.Using ui-bootstrap version 0.5.0, AngularJS version 1.0.7.
For instance:
Apologies for not attaching a jsfiddle or plunkr; I can't convince either to play nice this morning.
The text was updated successfully, but these errors were encountered: