← Back
Stripe
Stripe.js Address Element defaults to Latin character formatting in breaking change
Stripe APIStripe · breaking-changeapisdk · docs.stripe.com ↗

Breaking Change: Address Element State Formatting

Stripe.js has changed how the Address Element handles the state property. The getValue() method and address change events now return the state value in Latin character formatting by default, instead of matching the user's browser locale.

What Changed

  • Before: The state field returned values formatted according to the user's browser locale
  • After: The state field defaults to Latin character formatting
  • The address change event always returns Latin-formatted state values

Migration Steps

If your application expects localized state values, you need to update your code:

  1. For getValue() calls: Pass the format: 'localized' option to retrieve browser-localized values:

    addressElement.getValue({format: 'localized'})
    
  2. For change events: Call getValue({format: 'localized'}) within the event callback to retrieve localized values

  3. For stored expectations: Update any code that parses or validates state values to expect Latin characters by default

Context

This change is part of Stripe's Dahlia API version and is accompanied by several other breaking changes to Elements and Stripe.js, including updates to the Payment Element configuration, the elements.update() method, and removal of deprecated methods.