fix: fix the issue that if there is only one input field in the page form, the page will reload when the Enter key is pressed

This commit is contained in:
NFish 2024-09-26 12:39:08 +08:00
parent 3a84c21985
commit 4dad2eca69
3 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,7 @@ export default function CheckCode() {
</div>
<form action="">
<input type='text' className='hidden' />
<label htmlFor="code" className='system-md-semibold text-text-secondary mb-1'>{t('login.checkCode.verificationCode')}</label>
<Input value={code} onChange={e => setVerifyCode(e.target.value)} max-length={6} className='mt-1' placeholder={t('login.checkCode.verificationCodePlaceholder') as string} />
<Button loading={loading} disabled={loading} className='my-3 w-full' variant='primary' onClick={verify}>{t('login.checkCode.verify')}</Button>

View File

@ -62,6 +62,7 @@ export default function CheckCode() {
</div>
<form onSubmit={() => { }}>
<input type='text' className='hidden' />
<div className='mb-2'>
<label htmlFor="email" className='my-2 system-md-semibold text-text-secondary'>{t('login.email')}</label>
<div className='mt-1'>

View File

@ -53,6 +53,7 @@ export default function MailAndCodeAuth({ isInvite }: MailAndCodeAuthProps) {
}
return (<form onSubmit={() => { }}>
<input type='text' className='hidden' />
<div className='mb-2'>
<label htmlFor="email" className='my-2 system-md-semibold text-text-secondary'>{t('login.email')}</label>
<div className='mt-1'>