|
@@ -78,6 +78,7 @@ export const PhoneNumberInput = React.forwardRef< |
|
|
forwardedRef, |
|
|
forwardedRef, |
|
|
) => { |
|
|
) => { |
|
|
const { clientSide } = useClientSide({ clientSide: enhanced }); |
|
|
const { clientSide } = useClientSide({ clientSide: enhanced }); |
|
|
|
|
|
const [phoneNumber, setPhoneNumber] = React.useState<Value>(value?.toString() ?? ''); |
|
|
const labelId = React.useId(); |
|
|
const labelId = React.useId(); |
|
|
const defaultId = React.useId(); |
|
|
const defaultId = React.useId(); |
|
|
const id = idProp ?? defaultId; |
|
|
const id = idProp ?? defaultId; |
|
@@ -92,7 +93,8 @@ export const PhoneNumberInput = React.forwardRef< |
|
|
if (!input) { |
|
|
if (!input) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
delegateTriggerEvent('change', input, phoneNumberValue); |
|
|
|
|
|
|
|
|
setPhoneNumber(phoneNumberValue); |
|
|
|
|
|
delegateTriggerEvent('change', input, phoneNumberValue ?? ''); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const commonInputStyles = clsx( |
|
|
const commonInputStyles = clsx( |
|
@@ -157,6 +159,7 @@ export const PhoneNumberInput = React.forwardRef< |
|
|
<PhoneInput |
|
|
<PhoneInput |
|
|
{...etcProps} |
|
|
{...etcProps} |
|
|
ref={undefined} |
|
|
ref={undefined} |
|
|
|
|
|
value={phoneNumber} |
|
|
onChange={handlePhoneInputChange} |
|
|
onChange={handlePhoneInputChange} |
|
|
defaultCountry={defaultCountry} |
|
|
defaultCountry={defaultCountry} |
|
|
className={commonInputStyles} |
|
|
className={commonInputStyles} |
|
|