mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 06:08:11 +00:00
[Date Input] Addressed issues with date selector. Fixes #1000
This commit is contained in:
@ -72,6 +72,17 @@ define(
|
||||
if ($scope.ngBlur) {
|
||||
$scope.ngBlur();
|
||||
}
|
||||
|
||||
// If picker is active, dismiss it when valid value has been selected
|
||||
// This 'if' is to avoid unnecessary validation if picker is not active
|
||||
if ($scope.picker.active) {
|
||||
if ($scope.structure.validate && $scope.structure.validate($scope.ngModel[$scope.field])) {
|
||||
$scope.picker.active = false;
|
||||
} else if (!$scope.structure.validate) {
|
||||
//If picker visible, but no validation function, hide picker
|
||||
$scope.picker.active = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +104,6 @@ define(
|
||||
$scope.$watch('ngModel[field]', updateFromModel);
|
||||
$scope.$watch('pickerModel.value', updateFromPicker);
|
||||
$scope.$watch('textValue', updateFromView);
|
||||
|
||||
}
|
||||
|
||||
return DateTimeFieldController;
|
||||
|
@ -51,7 +51,9 @@ define(
|
||||
yMax = yMin + rect.height;
|
||||
|
||||
if (x < xMin || x > xMax || y < yMin || y > yMax) {
|
||||
scope.$eval(attrs.mctClickElsewhere);
|
||||
scope.$apply(function () {
|
||||
scope.$eval(attrs.mctClickElsewhere);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user