Closed Sladeck closed 5 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Thanks for the bug report @Sladeck. I have passed along this issue for investigation.
Hi @Sladeck -- I'm an engineer who works on the Address Element. Thanks for sharing this.
It seems like the root cause is that the value
attribute on the <option>
element language isn't what you're expecting. I dug into our code and found we have some logic around what we use for the value
attribute.
Here's the logic:
window.navigator
object (languages[]
, language
, userLanguage
),Then we use the latinName if we have it. In all other cases, we the local language. This logic ensures we're best aligned with how Google autocomplete functions.
If this continues to be an issue, can you take a look at the two bullets I mentioned above, and let us know if you still have concerns. As of now, we haven't had any other reports, so I'm going to close this as "by design".
What happened?
What Happened
When retrieving a Customer data from the V1 endpoint and using the ReactJS Stripe npm package (
@stripe/react-stripe-js @stripe/stripe-js
), the stringstate
in theaddress
dict does not match any values inside the select HTML element.If the Customer's address is in Tokyo, the value of
state
is equal to東京都
(Tokyo in Japanese) but the expected value isTokyo
, therefore passing the customer's data directly into the option result in an empty select.To Reproduce
stripe.Customer.retrieve("cus_NffrFeUfNV2Hib")
AddressElement
:// .... return function -> <AddressElement options={options} />
I could not find any informations regarding any parameter to change the language when retrieving customer data, it seems like the
AddressElement
component adapts to the browser's locale settings to automatically localize placeholder text, thereby influencing elements like country/state/city dropdowns.In such cases, those dropdowns input are empty.
Expected behavior:
One of the
<option>
value inside the<select>
of theAddressElement
component should matchstate: state_value
.Suggestions:
Environment
No response
Reproduction
No response