diff --git a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js index e6b8fb53a4441..0c9b5c1e37768 100644 --- a/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js +++ b/app/code/Magento/Ui/view/base/web/js/lib/validation/rules.js @@ -4,11 +4,12 @@ */ define([ './utils', + 'underscore', 'jquery', 'jquery/validate', 'jquery/ui', 'mage/translate' -], function (utils, $) { +], function (utils, _, $) { 'use strict'; /** @@ -47,13 +48,13 @@ define([ return { "min_text_length": [ function (value, params) { - return value.length == 0 || value.length >= +params; + return _.isUndefined(value) || value.length == 0 || value.length >= +params; }, $.mage.__('Please enter more or equal than {0} symbols.') ], "max_text_length": [ function (value, params) { - return value.length <= +params; + return !_.isUndefined(value) && value.length <= +params; }, $.mage.__('Please enter less or equal than {0} symbols.') ],