Skip to content

Scheduling infrastructure for absolutely everyone.

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

Gaurav Kumar5e3fe3cbe60e
diff --git a/apps/web/components/phone-input/PhoneInput.tsx b/apps/web/components/phone-input/PhoneInput.tsx
index a82ab7b1d6a..36949c4ec08 100644
--- a/apps/web/components/phone-input/PhoneInput.tsx
+++ b/apps/web/components/phone-input/PhoneInput.tsx
@@ -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}