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: login improvement (#941)

Matri062e2e915ba4
diff --git a/web/app/components/base/button/index.tsx b/web/app/components/base/button/index.tsx
index cbf1533eb62..f28f9b47858 100644
--- a/web/app/components/base/button/index.tsx
+++ b/web/app/components/base/button/index.tsx
@@ -7,6 +7,7 @@ export type IButtonProps = {
className?: string
disabled?: boolean
loading?: boolean
+ tabIndex?: number
children: React.ReactNode
onClick?: MouseEventHandler<HTMLDivElement>
}
@@ -18,6 +19,7 @@ const Button: FC<IButtonProps> = ({
className,
onClick,
loading = false,
+ tabIndex,
}) => {
let style = 'cursor-pointer'
switch (type) {
@@ -35,6 +37,7 @@ const Button: FC<IButtonProps> = ({
return (
<div
className={`inline-flex justify-center items-center content-center h-9 leading-5 rounded-lg px-4 py-2 text-base ${style} ${className && className}`}
+ tabIndex={tabIndex}
onClick={disabled ? undefined : onClick}
>
{children}
diff --git a/web/app/signin/normalForm.tsx b/web/app/signin/normalForm.tsx
index d28c7c0cee7..efb3de7839c 100644
--- a/web/app/signin/normalForm.tsx
+++ b/web/app/signin/normalForm.tsx
@@ -237,6 +237,10 @@ const NormalForm = () => {
id="password"
value={password}
onChange={e => setPassword(e.target.value)}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter')
+ handleEmailPasswordLogin()
+ }}
type={showPassword ? 'text' : 'password'}
autoComplete="current-password"
placeholder={t('login.passwordPlaceholder') || ''}
@@ -256,6 +260,7 @@ const NormalForm = () => {
<div className='mb-2'>
<Button
+ tabIndex={0}
type='primary'
onClick={handleEmailPasswordLogin}
disabled={isLoading}