Skip to content

Commit 5d440c5

Browse files
committed
Cleaning values before populate
1 parent 140d591 commit 5d440c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/region-updater.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,11 @@ define([
162162
this._clearError();
163163
this._checkRegionRequired(country);
164164

165+
$(regionList).find('option:selected').removeAttr('selected');
166+
regionInput.val('');
167+
165168
// Populate state/province dropdown list if available or use input box
166169
if (this.options.regionJson[country]) {
167-
$(regionList).find('option:selected').removeAttr('selected');
168170
this._removeSelectOptions(regionList);
169171
$.each(this.options.regionJson[country], $.proxy(function (key, value) {
170172
this._renderSelectOption(regionList, key, value);
@@ -199,7 +201,6 @@ define([
199201
regionInput.hide();
200202
label.attr('for', regionList.attr('id'));
201203
} else {
202-
regionInput.val('');
203204
this._removeSelectOptions(regionList);
204205

205206
if (this.options.isRegionRequired) {

0 commit comments

Comments
 (0)