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:
parent
e472ed3540
commit
6344c4defb
3 changed files with 16 additions and 4 deletions
|
@ -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}
|
||||
|
|
|
@ -101,6 +101,7 @@ const ConnectorContent = ({ isDeleted, connectorData, onConnectorUpdated }: Prop
|
|||
return (
|
||||
<FormProvider {...methods}>
|
||||
<DetailsForm
|
||||
autoComplete="off"
|
||||
isDirty={isDirty}
|
||||
isSubmitting={isSubmitting}
|
||||
onDiscard={reset}
|
||||
|
|
|
@ -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}>
|
||||
|
|
Loading…
Reference in a new issue