Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: prevent trigger form submit action when press 'enter' (#22313)

NFishd9eb5554b383
diff --git a/web/app/signin/invite-settings/page.tsx b/web/app/signin/invite-settings/page.tsx
index 0480c2acb81..1ff1c7d6713 100644
--- a/web/app/signin/invite-settings/page.tsx
+++ b/web/app/signin/invite-settings/page.tsx
@@ -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>