From 3cdc3dcad281d116143e7971b32ebc22a2ed927c Mon Sep 17 00:00:00 2001 From: Bogdan Mazur Date: Tue, 2 Jul 2024 10:16:55 +0200 Subject: [PATCH] commit --- src/bundle/Resources/public/js/scripts/fieldType/ezstring.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezstring.js b/src/bundle/Resources/public/js/scripts/fieldType/ezstring.js index e9792b8f97..1893146f0e 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezstring.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezstring.js @@ -17,7 +17,7 @@ const isEmpty = !event.target.value; const isTooShort = event.target.value.length < parseInt(event.target.dataset.min, 10); const isTooLong = event.target.value.length > parseInt(event.target.dataset.max, 10); - const isError = (isEmpty && isRequired) || isTooShort || isTooLong; + const isError = (isEmpty && isRequired) || (!isEmpty && (isTooShort || isTooLong)); const label = event.target.closest(SELECTOR_FIELD).querySelector('.ez-field-edit__label').innerHTML; const result = { isError };