We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d69d8f6 commit 3f41c04Copy full SHA for 3f41c04
bundle/Resources/public/admin/js/fieldType/eztags.js
@@ -1,10 +1,12 @@
1
(function (global, doc, ibexa) {
2
- const SELECTOR_FIELD = '.ibexa-field-edit--eztags.ibexa-field-edit--required';
+ const SELECTOR_FIELD = '.ibexa-field-edit--eztags';
3
4
class TagsValidator extends ibexa.BaseFieldValidator {
5
- validateTags(event) {
+ validateTags(event) {
6
+ const fieldContainer = event.currentTarget.closest(SELECTOR_FIELD);
7
+ const isRequired = fieldContainer && fieldContainer.classList.contains('ibexa-field-edit--required');
8
const isEmpty = !event.target.value;
- const isError = isEmpty;
9
+ const isError = isRequired && isEmpty;
10
const label = event.target.closest(SELECTOR_FIELD).querySelector('.ibexa-field-edit__label').innerHTML;
11
const result = {isError};
12
if (isEmpty) {
0 commit comments