chore: add autocomplete for inputs - name, phone, location (#24422)

* add autocomplete for inputs - name, phone, location

* Addressed coderabits comments

* autocomplete for email and url

---------

Co-authored-by: Anik Dhabal Babu <[email protected]>
This commit is contained in:
Dhairyashil ShindeandAnik Dhabal Babu authored and GitHub committed 2025-10-24 21:36:41 +00:00
1 parent 013e614397
commit b183239ff5
3 files changed
+13 -1

No files matched your search

@@ -68,6 +68,7 @@ function BasePhoneInput({
name, name,
required: rest.required, required: rest.required,
placeholder: rest.placeholder, placeholder: rest.placeholder,
autoComplete: "tel",
}} }}
onChange={(val: string) => { onChange={(val: string) => {
onChange(`+${val}`); onChange(`+${val}`);
@@ -118,6 +119,7 @@ function BasePhoneInputWeb({
name, name,
required: rest.required, required: rest.required,
placeholder: rest.placeholder, placeholder: rest.placeholder,
autoComplete: "tel",
}} }}
onChange={(val: string) => { onChange={(val: string) => {
onChange(`+${val}`); onChange(`+${val}`);
+10 -1
View File
@@ -145,6 +145,7 @@ export const Components: Record<FieldType, Component> = {
value={value} value={value}
required={variantField.required} required={variantField.required}
type="text" type="text"
autoComplete="name"
onChange={(e) => { onChange={(e) => {
props.setValue(e.target.value); props.setValue(e.target.value);
}} }}
@@ -174,6 +175,13 @@ export const Components: Record<FieldType, Component> = {
value={value[variantField.name as keyof typeof value]} value={value[variantField.name as keyof typeof value]}
required={variantField.required} required={variantField.required}
type="text" type="text"
autoComplete={
variantField.name === "firstName"
? "given-name"
: variantField.name === "lastName"
? "family-name"
: undefined
}
onChange={(e) => onChange(variantField.name, e.target.value)} onChange={(e) => onChange(variantField.name, e.target.value)}
/> />
))} ))}
@@ -211,6 +219,7 @@ export const Components: Record<FieldType, Component> = {
type="email" type="email"
id={props.name} id={props.name}
noLabel={true} noLabel={true}
autoComplete="email"
{...props} {...props}
onChange={(e) => props.setValue(e.target.value)} onChange={(e) => props.setValue(e.target.value)}
/> />
@@ -543,7 +552,7 @@ export const Components: Record<FieldType, Component> = {
url: { url: {
propsType: propsTypes.url, propsType: propsTypes.url,
factory: (props) => { factory: (props) => {
return <Widgets.TextWidget type="url" noLabel={true} {...props} />; return <Widgets.TextWidget type="url" autoComplete="url" noLabel={true} {...props} />;
}, },
}, },
} as const; } as const;
@@ -22,6 +22,7 @@ function AddressInput({ value, onChange, ...rest }: AddressInputProps) {
/> />
<Input <Input
{...rest} {...rest}
autoComplete="address-line1"
value={value} value={value}
onChange={(e) => { onChange={(e) => {
onChange(e.target.value); onChange(e.target.value);