diff --git a/app/code/Magento/Ui/view/base/web/js/form/element/region.js b/app/code/Magento/Ui/view/base/web/js/form/element/region.js index 4b12b72a8fc70..3fabe843f73e2 100644 --- a/app/code/Magento/Ui/view/base/web/js/form/element/region.js +++ b/app/code/Magento/Ui/view/base/web/js/form/element/region.js @@ -24,6 +24,7 @@ define([ update: function (value) { var country = registry.get(this.parentName + '.' + 'country_id'), options = country.indexedOptions, + isRegionRequired, option; if (!value) { @@ -43,6 +44,14 @@ define([ this.validation['required-entry'] = true; } + if (option && !this.options().length) { + registry.get(this.customName, function (input) { + isRegionRequired = !!option['is_region_required']; + input.validation['required-entry'] = isRegionRequired; + input.required(isRegionRequired); + }); + } + this.required(!!option['is_region_required']); } },