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 };