We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3270c97 commit 19e1c5aCopy full SHA for 19e1c5a
app/code/Magento/Customer/view/adminhtml/web/js/form/element/region.js
@@ -21,10 +21,16 @@ define([
21
setDifferedFromDefault: function (value) {
22
this._super();
23
24
- let label = parseFloat(value) ? this.indexedOptions[value].label : '';
25
-
26
- this.source.set(this.regionScope,label);
+ const indexedOptionsArray = Object.values(this.indexedOptions),
+ countryId = this.source.data.country_id,
+ hasRegionList = indexedOptionsArray.some(option => option.country_id === countryId);
27
28
+ this.source.set(
29
+ this.regionScope,
30
+ hasRegionList
31
+ ? parseFloat(value) ? this.indexedOptions?.[value]?.label || '' : ''
32
+ : this.source.data?.region || ''
33
+ );
34
}
35
});
36
0 commit comments