Skip to content

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

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

3 participants