Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: listen for "Enter" key on login input field #2148

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yusefnapora
Copy link
Contributor

This closes #2143 by adding an onKeyDown handler to the email input field on the login form. If the Enter key was pressed, it calls onLoginWithEmail to trigger the login request.

@yusefnapora yusefnapora requested a review from a team as a code owner December 5, 2022 15:29
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2022

@@ -91,6 +91,7 @@ const Login = () => {
className={clsx('login-email', errors.email && 'error')}
placeholder={pageContent.form_placeholder}
onChange={useCallback(e => setFormData({ email: e.currentTarget.value }), [])}
onKeyDown={e => e.key === 'Enter' && onLoginWithEmail()}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in a <form> element with an onSubmit handler. Then the key press listener is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Sign Up/ Login" Button should react to enter key
2 participants