Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/curly-cycles-march.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Add data-1p-ignore to input fields that do not benefit from password manager suggestions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export const CreateOrganizationForm = withCardStateProvider((props: CreateOrgani
onChange={onChangeName}
isRequired
autoFocus
ignorePasswordManager
/>
</Form.ControlRow>
<Form.ControlRow elementId={slugField.id}>
Expand All @@ -184,6 +185,7 @@ export const CreateOrganizationForm = withCardStateProvider((props: CreateOrgani
onChange={onChangeSlug}
isRequired
pattern='^[a-z0-9\-]+$'
ignorePasswordManager
/>
</Form.ControlRow>
<FormButtonContainer sx={t => ({ marginTop: t.space.$none })}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const AddDomainForm = withCardStateProvider((props: AddDomainFormProps) =
<Form.PlainInput
{...nameField.props}
autoFocus
ignorePasswordManager
isRequired
/>
</Form.ControlRow>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ export const ProfileForm = withCardStateProvider((props: ProfileFormProps) => {
{...nameField.props}
autoFocus
isRequired
ignorePasswordManager
/>
</Form.ControlRow>
<Form.ControlRow elementId={slugField.id}>
<Form.PlainInput
{...slugField.props}
onChange={onChangeSlug}
ignorePasswordManager
/>
</Form.ControlRow>
<FormButtons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export const VerifyDomainForm = withCardStateProvider((props: VerifyDomainFormPr
{...emailField.props}
autoFocus
groupSuffix={emailDomainSuffix}
ignorePasswordManager
/>
</Form.ControlRow>
<FormButtons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ export const DeleteUserForm = withCardStateProvider((props: DeleteUserFormProps)
</Col>

<Form.ControlRow elementId={confirmationField.id}>
<Form.PlainInput {...confirmationField.props} />
<Form.PlainInput
{...confirmationField.props}
ignorePasswordManager
/>
</Form.ControlRow>
<FormButtons
submitLabel={localizationKeys('userProfile.deletePage.confirm')}
Expand Down
13 changes: 12 additions & 1 deletion packages/clerk-js/src/ui/primitives/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ export type InputProps = PrimitiveProps<'input'> & StyleVariants<typeof applyVar
export const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref) => {
const fieldControl = useFormField() || {};
// @ts-expect-error Typescript is complaining that `errorMessageId` does not exist. We are clearly passing them from above.
const { errorMessageId, ...fieldControlProps } = sanitizeInputProps(fieldControl, ['errorMessageId']);
const { errorMessageId, ignorePasswordManager, ...fieldControlProps } = sanitizeInputProps(fieldControl, [
'errorMessageId',
'ignorePasswordManager',
]);

const propsWithoutVariants = filterProps({
...props,
hasError: props.hasError || fieldControlProps.hasError,
Expand All @@ -66,10 +70,17 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>((props, ref)
}
: { type };

const passwordManagerProps = ignorePasswordManager
? {
'data-1p-ignore': true,
}
: undefined;

return (
<input
{...rest}
{...typeProps}
{...passwordManagerProps}
ref={ref}
onChange={onChange}
disabled={isDisabled}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const sanitizeInputProps = (
clearFeedback,
infoText,
debouncedFeedback,
ignorePasswordManager,
...inputProps
} = obj;
/* eslint-enable */
Expand Down
1 change: 1 addition & 0 deletions packages/clerk-js/src/ui/utils/useFormControl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ type FieldStateProps<Id> = {
clearFeedback: () => void;
hasPassedComplexity: boolean;
isFocused: boolean;
ignorePasswordManager?: boolean;
} & Omit<Options, 'defaultChecked'>;

export type FormControlState<Id = string> = FieldStateProps<Id> & {
Expand Down