feat: support enter to signin (#1014)

This commit is contained in:
Zeng1998 2023-02-06 20:03:33 +08:00 committed by GitHub
parent 76c42c6c9f
commit 771ef44d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,6 +117,12 @@ const Auth = () => {
actionBtnLoadingState.setFinish();
};
const handleSignInKeyUp = (e: React.KeyboardEvent) => {
if (e.key === "Enter") {
handleSignInBtnClick();
}
};
return (
<div className="page-wrapper auth">
<div className="page-container">
@ -135,7 +141,14 @@ const Auth = () => {
</div>
<div className="form-item-container input-form-container">
<span className={`normal-text ${password ? "not-null" : ""}`}>{t("common.password")}</span>
<input className="input-text" type="password" value={password} onChange={handlePasswordInputChanged} required />
<input
className="input-text"
type="password"
value={password}
onChange={handlePasswordInputChanged}
onKeyUp={handleSignInKeyUp}
required
/>
</div>
</div>
<div className="action-btns-container">