angular-strap icon indicating copy to clipboard operation
angular-strap copied to clipboard

Empty values on datepicker and ng-required attribute

Open macku opened this issue 12 years ago • 2 comments

Please take a look and this code: http://plnkr.co/edit/FBw7VDFlJR9TcqmGW1My

  1. Check validity status and error for second field: $scope.testForm.dateFieldRequired.$valid; $scope.testForm.dateFieldRequired.$error = {"date": true, "parse": true}
  2. Select any date in each of fields using datepicker.
  3. Fields are valid and there are no errors $scope.testForm.dateField.$valid = true $scope.testForm.dateFieldRequired.$valid = true
  4. Now, remove each value on field using mouse and/or keyboard.
  5. Check validity status and error for both fields: $scope.testForm.dateField.$valid = false; $scope.testForm.dateField.$error = {"parse": true}; $scope.testForm.dateFieldRequired.$valid = false; $scope.testForm.dateFieldRequired.$error = {"parse": true};

Why exactly the first field is marked as invalid when value is not provided? IMHO since this field don't contains ng-required attribute it shouldn't be validated when it is empty. More important why there is parse error for each of those fields?

Am I missing something here?

macku avatar Nov 06 '14 11:11 macku

Fixed in cfe9e3e98b95b79335751f3904b2a24233455852 and ef270789a837f7891627ea444ec5415c7d9420da. Please see commit notes for details of resolution.

vmlf01 avatar Nov 09 '14 14:11 vmlf01

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock avatar Jan 26 '19 13:01 lock