From 87a7e84cbabdf5f692e52f2d73c6b474092bfaab Mon Sep 17 00:00:00 2001 From: Jan Skovgaard <1932158+BatJan@users.noreply.github.com> Date: Tue, 13 Jul 2021 09:57:20 +0200 Subject: [PATCH] Bugfix: #10414 - Validation message doesn't disappear once the issue is fixed (#10581) * Add missing focus styling * Fix issue where validation message does not disappear when all chars are removed Co-authored-by: BatJan Co-authored-by: Jan Skovgaard Olsen --- .../src/views/propertyeditors/textbox/textbox.controller.js | 4 ++++ .../src/views/propertyeditors/textbox/textbox.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js index b7c740e749..3e4539c6ae 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.controller.js @@ -31,6 +31,10 @@ function textboxController($scope, validationMessageService) { checkLengthVadility(); $scope.nearMaxLimit = $scope.validLength && $scope.charsCount > Math.max($scope.maxChars*.8, $scope.maxChars-25); } + else { + $scope.charsCount = 0; + checkLengthVadility(); + } } $scope.model.onValueChanged = $scope.change; $scope.change(); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html index 5e135ea7d9..1f1131c43f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/textbox/textbox.html @@ -10,7 +10,7 @@ aria-required="{{model.validation.mandatory}}" aria-invalid="False" ng-trim="false" - ng-keyup="change()" /> + ng-change="change()" />

{{model.label}} {{textboxFieldForm.textbox.errorMsg}}