0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(console): turn off auto-complete in connector forms (#3494)

This commit is contained in:
Gao Sun 2023-03-19 10:21:29 +08:00 committed by GitHub
parent e472ed3540
commit 6344c4defb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 4 deletions

View file

@ -5,16 +5,27 @@ import SubmitFormChangesActionBar from '../SubmitFormChangesActionBar';
import * as styles from './index.module.scss';
type Props = {
autoComplete?: string;
isDirty: boolean;
isSubmitting: boolean;
children: ReactNode;
onSubmit: () => Promise<void>;
onDiscard: () => void;
children: ReactNode;
};
const DetailsForm = ({ isDirty, isSubmitting, onSubmit, onDiscard, children }: Props) => {
const DetailsForm = ({
autoComplete,
isDirty,
isSubmitting,
onSubmit,
onDiscard,
children,
}: Props) => {
return (
<form className={classNames(styles.container, isDirty && styles.withSubmitActionBar)}>
<form
className={classNames(styles.container, isDirty && styles.withSubmitActionBar)}
autoComplete={autoComplete}
>
<div className={styles.fields}>{children}</div>
<SubmitFormChangesActionBar
isOpen={isDirty}

View file

@ -101,6 +101,7 @@ const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Prop
return (
<FormProvider {...methods}>
<DetailsForm
autoComplete="off"
isDirty={isDirty}
isSubmitting={isSubmitting}
onDiscard={reset}

View file

@ -181,7 +181,7 @@ const Guide = ({ connector, onClose }: Props) => {
</div>
<div className={styles.setup}>
<FormProvider {...methods}>
<form onSubmit={onSubmit}>
<form autoComplete="off" onSubmit={onSubmit}>
{isSocialConnector && (
<div className={styles.block}>
<div className={styles.blockTitle}>