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 (#2122)
  • Loading branch information
vidarl authored Jul 2, 2024
1 parent f1a7540 commit 81d2231
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 81d2231

Please sign in to comment.