fix: submit with enter in enter password form

This commit is contained in:
Koosha Lahouti
2025-09-24 12:00:40 +03:30
parent 3e4fc1960f
commit ef4085de6e

View File

@@ -142,7 +142,16 @@ export const EnterPasswordForm = ({
</LTRBox> </LTRBox>
</Button> </Button>
</Box> </Box>
<Box
component="form"
onSubmit={(e) => {
e.preventDefault();
e.stopPropagation();
if (!loginWithPassLoading) {
void handleSubmit();
}
}}
>
<Typography variant="body2" color="textSecondary" sx={{ mt: 1, mb: 2 }}> <Typography variant="body2" color="textSecondary" sx={{ mt: 1, mb: 2 }}>
{t('enterPassword.enterThePasswordYouSetForYourAccount')} {t('enterPassword.enterThePasswordYouSetForYourAccount')}
</Typography> </Typography>
@@ -190,13 +199,16 @@ export const EnterPasswordForm = ({
</Button> </Button>
<Stack spacing={1}> <Stack spacing={1}>
<Button loading={loginWithPassLoading} onClick={handleSubmit}> <Button loading={loginWithPassLoading}>
{t('verify.confirmAndLogin')} {t('verify.confirmAndLogin')}
</Button> </Button>
<Link to="/forget-password"> <Link to="/forget-password">
<Button variant="text">{t('enterPassword.iForgotMyPassword')}</Button> <Button variant="text">
{t('enterPassword.iForgotMyPassword')}
</Button>
</Link> </Link>
</Stack> </Stack>
</Box>
</AuthenticationCard> </AuthenticationCard>
); );
}; };