From ee0bb78ca189ea61c4b84d6b6b2f16a88bd7e2a2 Mon Sep 17 00:00:00 2001 From: Raghavendra Date: Mon, 20 Feb 2023 18:01:33 +0530 Subject: [PATCH 1/4] BUG#PWA-3065 When the button sign in is pressed by the keyboard, nothing happens --- packages/peregrine/lib/talons/SignIn/useSignIn.js | 9 +++++++++ packages/venia-ui/lib/components/SignIn/signIn.js | 2 ++ 2 files changed, 11 insertions(+) diff --git a/packages/peregrine/lib/talons/SignIn/useSignIn.js b/packages/peregrine/lib/talons/SignIn/useSignIn.js index 4957083b32..651e2ac319 100644 --- a/packages/peregrine/lib/talons/SignIn/useSignIn.js +++ b/packages/peregrine/lib/talons/SignIn/useSignIn.js @@ -173,6 +173,14 @@ export const useSignIn = props => { }; }, [handleCreateAccount]); + const signinHandleEnterKeyPress = useCallback(() => { + event => { + if (event.key === 'Enter') { + handleSubmit(); + } + }; + }, [handleSubmit]); + const errors = useMemo( () => new Map([ @@ -186,6 +194,7 @@ export const useSignIn = props => { errors, handleCreateAccount, handleEnterKeyPress, + signinHandleEnterKeyPress, handleForgotPassword, handleSubmit, isBusy: isGettingDetails || isSigningIn || recaptchaLoading, diff --git a/packages/venia-ui/lib/components/SignIn/signIn.js b/packages/venia-ui/lib/components/SignIn/signIn.js index 372ba2e60d..f2527ee0eb 100644 --- a/packages/venia-ui/lib/components/SignIn/signIn.js +++ b/packages/venia-ui/lib/components/SignIn/signIn.js @@ -37,6 +37,7 @@ const SignIn = props => { errors, handleCreateAccount, handleEnterKeyPress, + signinHandleEnterKeyPress, handleForgotPassword, handleSubmit, isBusy, @@ -119,6 +120,7 @@ const SignIn = props => {