From 9bc047c03f50e4795fc0d13b71af8218889d1e5a Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 15 Jan 2019 10:17:26 +0100 Subject: [PATCH] Adding code to re-validate on value change --- .../directives/components/tags/umbtagseditor.directive.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js index fea7528d5b..125f5ffb65 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tags/umbtagseditor.directive.js @@ -182,6 +182,9 @@ else { vm.onValueChanged({ value: [] }); } + + //this is required to re-validate + $scope.propertyForm.tagCount.$setViewValue($scope.model.value.length); } /** @@ -189,7 +192,7 @@ */ function validateMandatory() { return { - isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0) || (vm.value != null && vm.value.length > 0), + isValid: !vm.validation.mandatory || (vm.viewModel != null && vm.viewModel.length > 0), errorMsg: "Value cannot be empty", errorKey: "required" };