How to set a formatted string in PhoneField component without selecting the select box?

Topic summary

Main issue: Configure a PhoneField so the country is enforced or auto-set, and the phone input is automatically formatted as “+[countryCode][local phone number]” based on the buyerIdentity.countryCode found in the cart, without requiring the user to interact with the country dropdown.

Key questions:

  • Is there a supported way to programmatically set the PhoneField’s selected country and phone value using the cart’s buyerIdentity?
  • If auto-setting isn’t possible, can the app detect when the country dropdown is selected/changed (e.g., via an event or callback) to trigger formatting or validation?

Constraints/intent: Avoid manual country selection; prefer automatic formatting and/or enforcement tied to cart data.

Status: No responses or confirmed solutions yet; the thread remains open with unanswered implementation details.

Summarized with AI on January 2. AI used: gpt-5.

Hi, everyone.

I’m trying to figure out a way to force the user to select the country from the country select box or automatically set a formatted string(+[countryCode][local phone number]) based on the country code of the buyerIdentity in the cart object without selecting the country select box.
Is it possible to apply either way?

Or can I catch or detect the country select box is selected?