Set lookup value changed from something to nothing to be null

This commit is contained in:
gconsidine
2017-10-09 11:06:55 -04:00
committed by Matthew Jones
parent f93506fe2c
commit b7071a48c2
2 changed files with 6 additions and 6 deletions

View File

@@ -66,7 +66,7 @@ function AtFormController (eventService, strings) {
let data = vm.components let data = vm.components
.filter(component => component.category === 'input') .filter(component => component.category === 'input')
.reduce((values, component) => { .reduce((values, component) => {
if (!component.state._value) { if (component.state._value === undefined) {
return values; return values;
} }

View File

@@ -12,7 +12,7 @@ function atInputLookupLink (scope, element, attrs, controllers) {
inputController.init(scope, element, formController); inputController.init(scope, element, formController);
} }
function AtInputLookupController (baseInputController, $q, $state, $stateParams) { function AtInputLookupController (baseInputController, $q, $state) {
let vm = this || {}; let vm = this || {};
let scope; let scope;
@@ -82,6 +82,7 @@ function AtInputLookupController (baseInputController, $q, $state, $stateParams)
scope.state._touched = true; scope.state._touched = true;
if (scope.state._displayValue === '' && !scope.state._required) { if (scope.state._displayValue === '' && !scope.state._required) {
scope.state._value = null;
return vm.check({ isValid: true }); return vm.check({ isValid: true });
} }
@@ -116,8 +117,7 @@ function AtInputLookupController (baseInputController, $q, $state, $stateParams)
AtInputLookupController.$inject = [ AtInputLookupController.$inject = [
'BaseInputController', 'BaseInputController',
'$q', '$q',
'$state', '$state'
'$stateParams'
]; ];
function atInputLookup (pathService) { function atInputLookup (pathService) {