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.
2 parents 3d60370 + 98c567a commit 373f635Copy full SHA for 373f635
app/code/Magento/Customer/view/adminhtml/web/js/form/element/region.js
@@ -25,12 +25,15 @@ define([
25
countryId = this.source.data.country_id,
26
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
- );
+ // Clear the region field when the country changes
+ this.source.set(this.regionScope, '');
+
+ if (hasRegionList) {
+ this.source.set(
+ this.regionScope,
34
+ parseFloat(value) ? this.indexedOptions?.[value]?.label || '' : ''
35
+ );
36
+ }
37
}
38
});
39
0 commit comments