fix: prevent trigger form submit action when press 'enter' (#22313)
This commit is contained in:
@@ -16,6 +16,7 @@ import I18n from '@/context/i18n'
|
||||
import { activateMember, invitationCheck } from '@/service/common'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
import Toast from '@/app/components/base/toast'
|
||||
import { noop } from 'lodash-es'
|
||||
|
||||
export default function InviteSettingsPage() {
|
||||
const { t } = useTranslation()
|
||||
@@ -88,8 +89,7 @@ export default function InviteSettingsPage() {
|
||||
<div className='pb-4 pt-2'>
|
||||
<h2 className='title-4xl-semi-bold'>{t('login.setYourAccount')}</h2>
|
||||
</div>
|
||||
<form action=''>
|
||||
|
||||
<form onSubmit={noop}>
|
||||
<div className='mb-5'>
|
||||
<label htmlFor="name" className="system-md-semibold my-2">
|
||||
{t('login.name')}
|
||||
@@ -101,6 +101,13 @@ export default function InviteSettingsPage() {
|
||||
value={name}
|
||||
onChange={e => setName(e.target.value)}
|
||||
placeholder={t('login.namePlaceholder') || ''}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
handleActivate()
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user