Skip to content

Commit 7a2dd87

Browse files
committed
MC-36598: Default Billing address is not selected after the same address checkbox unticked
1 parent 4930963 commit 7a2dd87

File tree

1 file changed

+5
-1
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/view/billing-address

1 file changed

+5
-1
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/billing-address/list.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ define([
2323
},
2424
addressOptions = addressList().filter(function (address) {
2525
return address.getType() === 'customer-address';
26+
}),
27+
addressDefaultIndex = addressOptions.findIndex(function (address) {
28+
return address.isDefaultBilling();
2629
});
2730

2831
return Component.extend({
@@ -53,7 +56,8 @@ define([
5356
this._super()
5457
.observe('selectedAddress isNewAddressSelected')
5558
.observe({
56-
isNewAddressSelected: !customer.isLoggedIn() || !addressOptions.length
59+
isNewAddressSelected: !customer.isLoggedIn() || !addressOptions.length,
60+
selectedAddress: this.addressOptions[addressDefaultIndex]
5761
});
5862

5963
return this;

0 commit comments

Comments
 (0)