Fix login password onBlur

This commit is contained in:
ilya-bkv 2024-03-11 10:41:31 +03:00
parent ae589e39fa
commit 96d6e6bd0c
2 changed files with 5 additions and 4 deletions

View File

@ -156,7 +156,7 @@ export const LoginForm = () => {
<PasswordField <PasswordField
variant={'login'} variant={'login'}
setError={validationErrors().password} setError={validationErrors().password}
onInput={(value) => handlePasswordInput(value)} onBlur={(value) => handlePasswordInput(value)}
/> />
<Show when={submitError()}> <Show when={submitError()}>

View File

@ -12,7 +12,7 @@ type Props = {
placeholder?: string placeholder?: string
errorMessage?: (error: string) => void errorMessage?: (error: string) => void
setError?: string setError?: string
onInput: (value: string) => void onInput?: (value: string) => void
onBlur?: (value: string) => void onBlur?: (value: string) => void
variant?: 'login' | 'registration' variant?: 'login' | 'registration'
disableAutocomplete?: boolean disableAutocomplete?: boolean
@ -41,8 +41,9 @@ export const PasswordField = (props: Props) => {
} }
const handleInputBlur = (value: string) => { const handleInputBlur = (value: string) => {
if (props.variant === 'login') { if (props.variant === 'login' && props.onBlur) {
return props.onBlur(value) props.onBlur(value)
return
} }
if (value.length < 1) { if (value.length < 1) {
return return