From f946a7349ae1d6e61840a81d2975d7f7591a1117 Mon Sep 17 00:00:00 2001 From: Dariusz Szut Date: Thu, 3 Feb 2022 15:50:21 +0100 Subject: [PATCH] IBX-2218: Fixed richtext validation if only one characted (#307) --- .../Resources/public/js/scripts/fieldType/ezrichtext.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/public/js/scripts/fieldType/ezrichtext.js b/src/bundle/Resources/public/js/scripts/fieldType/ezrichtext.js index 7af6a1cffa..5aae95b885 100644 --- a/src/bundle/Resources/public/js/scripts/fieldType/ezrichtext.js +++ b/src/bundle/Resources/public/js/scripts/fieldType/ezrichtext.js @@ -49,9 +49,11 @@ const isEmpty = !this.richtextEditor.getData().length; const isError = isRequired && isEmpty; const result = { isError }; + if (isError) { result.errorMessage = ibexa.errors.emptyField.replace('{fieldName}', label); } + return result; } } @@ -67,7 +69,7 @@ richtextEditor, eventsMap: [ { - selector: SELECTOR_INPUT, + selector: '.ibexa-data-source__input.ibexa-input--textarea', eventName: 'input', callback: 'validateInput', errorNodeSelectors: [SELECTOR_ERROR_NODE],