feat: add Google Place Autocomplete for address fields (#13450)
resolve #13253 This PR enables the use of Google Place Autocomplete and Place Details APIs in the backend. It allows users to automatically fill in address fields by typing into the address1 input. The input is debounced, then the Autocomplete API is called. Once the user selects an address, the Place Details API is used to parse and fill in the individual address fields. https://github.com/user-attachments/assets/e04b8474-25b8-48f5-83d0-2074f8d5fc94 --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com> Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
@@ -234,6 +234,7 @@ export type TextInputV2ComponentProps = Omit<
|
||||
inheritFontStyles?: boolean;
|
||||
rightAdornment?: string;
|
||||
leftAdornment?: string;
|
||||
textClickOutsideId?: string;
|
||||
};
|
||||
|
||||
type TextInputV2WithAutoGrowWrapperProps = TextInputV2ComponentProps;
|
||||
@@ -273,6 +274,7 @@ const TextInputV2Component = forwardRef<
|
||||
autoGrow = false,
|
||||
rightAdornment,
|
||||
leftAdornment,
|
||||
textClickOutsideId,
|
||||
},
|
||||
ref,
|
||||
) => {
|
||||
@@ -300,7 +302,11 @@ const TextInputV2Component = forwardRef<
|
||||
const instanceId = useId();
|
||||
|
||||
return (
|
||||
<StyledContainer className={className} fullWidth={fullWidth ?? false}>
|
||||
<StyledContainer
|
||||
className={className}
|
||||
fullWidth={fullWidth ?? false}
|
||||
data-click-outside-id={textClickOutsideId}
|
||||
>
|
||||
{label && (
|
||||
<InputLabel htmlFor={instanceId}>
|
||||
{label + (required ? '*' : '')}
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
export const TEXT_INPUT_CLICK_OUTSIDE_ID = 'text-input-click-outside-id';
|
||||
Reference in New Issue
Block a user