Skip to content

Commit

Permalink
IBX-8350: Text line fields which is not marked as required, but has a…
Browse files Browse the repository at this point in the history
… minimum length constraint set, is basically treated as required
  • Loading branch information
vidarl committed Jun 5, 2024
1 parent ef36131 commit deeee5d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 };

Expand Down

0 comments on commit deeee5d

Please sign in to comment.