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 <81948346+anikdhabal@users.noreply.github.com>
This commit is contained in:
co-authored by
Anik Dhabal Babu
parent
013e614397
commit
b183239ff5
@@ -145,6 +145,7 @@ export const Components: Record<FieldType, Component> = {
|
||||
value={value}
|
||||
required={variantField.required}
|
||||
type="text"
|
||||
autoComplete="name"
|
||||
onChange={(e) => {
|
||||
props.setValue(e.target.value);
|
||||
}}
|
||||
@@ -174,6 +175,13 @@ export const Components: Record<FieldType, Component> = {
|
||||
value={value[variantField.name as keyof typeof value]}
|
||||
required={variantField.required}
|
||||
type="text"
|
||||
autoComplete={
|
||||
variantField.name === "firstName"
|
||||
? "given-name"
|
||||
: variantField.name === "lastName"
|
||||
? "family-name"
|
||||
: undefined
|
||||
}
|
||||
onChange={(e) => onChange(variantField.name, e.target.value)}
|
||||
/>
|
||||
))}
|
||||
@@ -211,6 +219,7 @@ export const Components: Record<FieldType, Component> = {
|
||||
type="email"
|
||||
id={props.name}
|
||||
noLabel={true}
|
||||
autoComplete="email"
|
||||
{...props}
|
||||
onChange={(e) => props.setValue(e.target.value)}
|
||||
/>
|
||||
@@ -543,7 +552,7 @@ export const Components: Record<FieldType, Component> = {
|
||||
url: {
|
||||
propsType: propsTypes.url,
|
||||
factory: (props) => {
|
||||
return <Widgets.TextWidget type="url" noLabel={true} {...props} />;
|
||||
return <Widgets.TextWidget type="url" autoComplete="url" noLabel={true} {...props} />;
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user