From b5da6e55ccd4109eb1aa7705540ffb0b4a30a805 Mon Sep 17 00:00:00 2001
From: Justin Shillingford <jgs272@cornell.edu>
Date: Tue, 30 Jun 2020 16:23:24 -0400
Subject: Next button on keyboard works again!

---
 src/screens/Login.tsx | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

(limited to 'src/screens/Login.tsx')

diff --git a/src/screens/Login.tsx b/src/screens/Login.tsx
index 6384eff1..417d9bd7 100644
--- a/src/screens/Login.tsx
+++ b/src/screens/Login.tsx
@@ -27,7 +27,7 @@ interface LoginProps {
 }
 
 const Login = ({navigation}: LoginProps) => {
-  // const passwordInput = useRef();
+  const input_ref = React.createRef();
   const [data, setData] = React.useState({
     username: '',
     password: '',
@@ -93,17 +93,12 @@ const Login = ({navigation}: LoginProps) => {
     Handler for the submit button on the Username keyboard
   */
   const handleUsernameSubmit = () => {
-    // setData({
-    //   ...data,
-    //   focusPasswordInput: true,
-    // });
-    Alert.alert('Coming soon 🚧');
-    // refs.password_input.focus()
+    input_ref.current.focus();
   };
 
   const handleRegistration = () => {
     navigation.navigate('Registration');
-  }
+  };
 
   return (
     <>
@@ -130,7 +125,6 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleUsernameSubmit()}
               isValid={data.isValidUser}
               validationWarning={'Username must be at least 6 characters long.'}
-              // ref={'username_input'}
             />
             <LoginInput
               type={data.password}
@@ -140,7 +134,7 @@ const Login = ({navigation}: LoginProps) => {
               onSubmitEditing={() => handleLogin()}
               isValid={data.isValidPassword}
               validationWarning={'Password must be at least 8 characters long.'}
-              // ref={'password_input'}
+              input_ref={input_ref}
             />
             <TouchableOpacity
               accessibilityLabel="Forgot password button"
-- 
cgit v1.2.3-70-g09d2

