fix(bookings): provide stable country fallback for phone input (#29740)

* fix(bookings): provide stable country fallback for phone input

* chore(bookings): add explanatory comment for phone input country fallback
This commit is contained in:
Gaurav Kumar
2026-08-05 06:29:34 +00:00
committed by GitHub
parent 8418db70c7
commit 5e3fe3cbe6
@@ -117,7 +117,10 @@ function BasePhoneInputWeb({
<PhoneInput
{...rest}
value={value ? value.trim().replace(/^\+?/, "+") : undefined}
country={value ? undefined : defaultCountry}
// react-phone-input-2 treats `country` as a fallback. Keeping it stable
// preserves calling-code-only values like `+371` during async updates,
// while full international numbers still resolve their country from `value`.
country={defaultCountry}
enableSearch
disableSearchIcon
masks={CUSTOM_PHONE_MASKS}