-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(login): Don't show password error on email input (#16727)
- Loading branch information
Showing
2 changed files
with
18 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,9 +92,13 @@ export function Login(): JSX.Element { | |
<h2>Log in</h2> | ||
{generalError && ( | ||
<LemonBanner type="error"> | ||
{generalError.detail || | ||
ERROR_MESSAGES[generalError.code] || | ||
'Could not complete your login. Please try again.'} | ||
{generalError.detail || ERROR_MESSAGES[generalError.code] || ( | ||
<> | ||
Could not complete your login. | ||
<br /> | ||
Please try again. | ||
</> | ||
)} | ||
</LemonBanner> | ||
)} | ||
<Form logic={loginLogic} formKey="login" enableFormOnSubmit className="space-y-4"> | ||
|
@@ -107,8 +111,12 @@ export function Login(): JSX.Element { | |
placeholder="[email protected]" | ||
type="email" | ||
onBlur={() => precheck({ email: login.email })} | ||
onPressEnter={() => { | ||
onPressEnter={(e) => { | ||
precheck({ email: login.email }) | ||
if (isPasswordHidden) { | ||
e.preventDefault() // Don't trigger submission if password field is still hidden | ||
passwordInputRef.current?.focus() | ||
} | ||
}} | ||
/> | ||
</Field> | ||
|