Skip to content

Commit

Permalink
fix: Move out of mui#4574
Browse files Browse the repository at this point in the history
  • Loading branch information
bharatkashyap committed Feb 12, 2025
1 parent 27a2434 commit 223fa80
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function BrandingSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function CredentialsSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function MagicLinkAlertSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function NotificationsSignInPageError() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function PasskeySignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ emailField: { autoFocus: false } }}
slotProps={{ emailField: { autoFocus: false }, form: { noValidate: true } }}
/>
</AppProvider>
// preview-end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default function ThemeSignInPage() {
<SignInPage
signIn={signIn}
providers={providers}
slotProps={{ form: { noValidate: true } }}
sx={{
'& form > .MuiStack-root': {
marginTop: '2rem',
Expand Down
7 changes: 7 additions & 0 deletions packages/toolpad-core/src/SignInPage/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ export interface SignInPageProps {
forgotPasswordLink?: LinkProps;
signUpLink?: LinkProps;
rememberMe?: Partial<FormControlLabelProps>;
form?: Partial<React.FormHTMLAttributes<HTMLFormElement>>;
oAuthButton?: LoadingButtonProps;
};
/**
* The prop used to customize the styles on the `SignInPage` container
Expand Down Expand Up @@ -375,6 +377,7 @@ function SignInPage(props: SignInPageProps) {
error: oauthResponse?.error,
}));
}}
{...slotProps?.form}
>
<LoadingButton
key={provider.id}
Expand All @@ -391,6 +394,7 @@ function SignInPage(props: SignInPageProps) {
sx={{
textTransform: 'capitalize',
}}
{...slotProps?.oAuthButton}
>
<span>Sign in with {provider.name}</span>
</LoadingButton>
Expand Down Expand Up @@ -424,6 +428,7 @@ function SignInPage(props: SignInPageProps) {
error: passkeyResponse?.error,
}));
}}
{...slotProps?.form}
>
{slots?.emailField ? (
<slots.emailField {...slotProps?.emailField} />
Expand Down Expand Up @@ -498,6 +503,7 @@ function SignInPage(props: SignInPageProps) {
success: emailResponse?.success,
}));
}}
{...slotProps?.form}
>
{slots?.emailField ? (
<slots.emailField {...slotProps?.emailField} />
Expand Down Expand Up @@ -570,6 +576,7 @@ function SignInPage(props: SignInPageProps) {
error: credentialsResponse?.error,
}));
}}
{...slotProps?.form}
>
<Stack direction="column" spacing={2} sx={{ mb: 2 }}>
{slots?.emailField ? (
Expand Down

0 comments on commit 223fa80

Please sign in to comment.