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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user