Skip to content

purchase.address-autocomplete.suggest - Not compatible with Additional Address Fields #2398

Open
@davingaffneyAA

Description

@davingaffneyAA

Please list the package(s) involved in the issue, and include the version you are using

// package.json
"@shopify/ui-extensions": "2024.7.0",

Describe the bug

Custom extensions using the purchase.address-autocomplete.suggest API throw an error when the Autocomplete field is active in the "Street" field.

Steps to reproduce the behavior:

  1. Create an extension using the purchase.address-autocomplete.suggest api
  2. Install in a locally running store (error is swallowed on live store) with additional fields activated
  3. Activate the extension in the checkout page
  4. Visit the checkout page
  5. Select Germany (or another country using additional fields) from the country selector
  6. Enter text in the "Street" field
  7. The error should be thrown in the console: "Unsupported Address Autocomplete field: streetName"

Expected behavior

The extension works in the street field the same as it does in the "address line 1" field.

Screenshots

Additional context

The issue appears to stem from the Field property of Target interface in the AddressAutocompleteSuggestApi (found here: https://github.com/Shopify/ui-extensions/blob/unstable/packages/ui-extensions/src/surfaces/checkout/api/address-autocomplete/suggest.ts)
The Field property is defined as:
field: 'address1' | 'zip';
When it is passed streetName as the origin field of the Autocomplete it throws the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions