Skip to content

Commit 5c04c2c

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-63200' into BUGS
2 parents 006d2ef + 4f2fa65 commit 5c04c2c

File tree

1 file changed

+9
-0
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/element

1 file changed

+9
-0
lines changed

app/code/Magento/Ui/view/base/web/js/form/element/region.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ define([
2424
update: function (value) {
2525
var country = registry.get(this.parentName + '.' + 'country_id'),
2626
options = country.indexedOptions,
27+
isRegionRequired,
2728
option;
2829

2930
if (!value) {
@@ -43,6 +44,14 @@ define([
4344
this.validation['required-entry'] = true;
4445
}
4546

47+
if (option && !this.options().length) {
48+
registry.get(this.customName, function (input) {
49+
isRegionRequired = !!option['is_region_required'];
50+
input.validation['required-entry'] = isRegionRequired;
51+
input.required(isRegionRequired);
52+
});
53+
}
54+
4655
this.required(!!option['is_region_required']);
4756
}
4857
},

0 commit comments

Comments
 (0)