|
@@ -83,7 +83,6 @@ export const PhoneNumberInput = React.forwardRef< |
|
|
const defaultId = React.useId(); |
|
|
const defaultId = React.useId(); |
|
|
const id = idProp ?? defaultId; |
|
|
const id = idProp ?? defaultId; |
|
|
const defaultRef = React.useRef<PhoneNumberInputDerivedElement>(null); |
|
|
const defaultRef = React.useRef<PhoneNumberInputDerivedElement>(null); |
|
|
const ref = forwardedRef ?? defaultRef; |
|
|
|
|
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
React.useEffect(() => { |
|
|
const { current: currentRaw } = defaultRef; |
|
|
const { current: currentRaw } = defaultRef; |
|
@@ -116,7 +115,7 @@ export const PhoneNumberInput = React.forwardRef< |
|
|
}, [forwardedRef, defaultRef]); |
|
|
}, [forwardedRef, defaultRef]); |
|
|
|
|
|
|
|
|
const handlePhoneInputChange = (phoneNumberValue: Value) => { |
|
|
const handlePhoneInputChange = (phoneNumberValue: Value) => { |
|
|
if (!(typeof ref === 'object' && ref)) { |
|
|
|
|
|
|
|
|
if (!(typeof defaultRef === 'object' && defaultRef)) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
const { current: input } = defaultRef; |
|
|
const { current: input } = defaultRef; |
|
|