Skip to content

Shipping Google autocomplete clears stateOrProvinceCode #2917

@nguyenchris

Description

@nguyenchris

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

  1. Use a checkout build after v1.765.2
  2. Go to the shipping step
  3. Use Google autocomplete in the shipping address field
  4. Select an address in a country with states/provinces, such as US, CA, or AU
  5. 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.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions