Description
After v1.765.2, Google autocomplete in the single shipping address form can populate the address but lose stateOrProvinceCode before the shipping address is finalized.
This does not appear to affect billing address autocomplete.
Steps To Reproduce
- Use a checkout build after
v1.765.2
- Go to the shipping step
- Use Google autocomplete in the shipping address field
- Select an address in a country with states/provinces, such as US, CA, or AU
- Inspect the resulting shipping address state or submitted payload
Expected Behavior
The shipping address should retain both:
stateOrProvince
stateOrProvinceCode
Actual Behavior
The shipping address can end up with:
- correct
countryCode
- correct address lines / city / postal code
- empty or cleared
stateOrProvinceCode
Suspected Cause
AddressForm applies autocomplete-mapped values together, including countryCode, stateOrProvince, and stateOrProvinceCode.
In shipping, SingleShippingForm clears stateOrProvince and stateOrProvinceCode whenever countryCode changes. Because autocomplete also updates countryCode as part of the same selection, the subdivision fields can be cleared during that update sequence.
Description
After v1.765.2, Google autocomplete in the single shipping address form can populate the address but lose
stateOrProvinceCodebefore the shipping address is finalized.This does not appear to affect billing address autocomplete.
Steps To Reproduce
v1.765.2Expected Behavior
The shipping address should retain both:
stateOrProvincestateOrProvinceCodeActual Behavior
The shipping address can end up with:
countryCodestateOrProvinceCodeSuspected Cause
AddressFormapplies autocomplete-mapped values together, includingcountryCode,stateOrProvince, andstateOrProvinceCode.In shipping,
SingleShippingFormclearsstateOrProvinceandstateOrProvinceCodewhenevercountryCodechanges. Because autocomplete also updatescountryCodeas part of the same selection, the subdivision fields can be cleared during that update sequence.