feat: full screen form for mobile
This commit is contained in:
@ -41,6 +41,7 @@ const PhoneInput = ({
|
||||
initialData.current.localValue
|
||||
);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const [dropdownWidth, setDropdownWidth] = useState<number>(300);
|
||||
|
||||
const lastNotifiedValue = useRef<string | null>(value ?? "");
|
||||
|
||||
@ -71,6 +72,11 @@ const PhoneInput = ({
|
||||
const { readOnly, disabled } = props;
|
||||
const leftSectionWidth = 90;
|
||||
|
||||
useEffect(() => {
|
||||
if (!inputRef.current?.offsetWidth) return;
|
||||
setDropdownWidth(inputRef.current?.offsetWidth);
|
||||
}, [inputRef.current?.offsetWidth]);
|
||||
|
||||
return (
|
||||
<InputBase
|
||||
{...props}
|
||||
@ -89,6 +95,7 @@ const PhoneInput = ({
|
||||
}
|
||||
}}
|
||||
leftSectionWidth={leftSectionWidth}
|
||||
inputWidth={dropdownWidth}
|
||||
/>
|
||||
}
|
||||
leftSectionWidth={leftSectionWidth}
|
||||
|
||||
Reference in New Issue
Block a user