zackify / react-native-autofocus

Autofocus the next input field on enter in React Native
https://zach.codes/autofocus-inputs-in-react-native/
86 stars 11 forks source link

autoFocus not working for input of keyboardType='numeric' #7

Open Jose24San opened 6 years ago

Jose24San commented 6 years ago

Great package! I am having a funky issue where the TextInput component loses the returnKey so I can't hit 'enter' when I finish typing a number so that the focus can change to the next input. Changing the keyboardType to : numeric or phone-pad seems to be breaking the returnKeyLabel. It works fine for keyboardType default and email-address.

Here is what my code looks like

<Form style={styles.formContainer}>
          <TextInput
              style={styles.input}
              placeholder="Weeks"
              keyboardType="numeric"
          />
          <TextInput
              style={styles.input}
              placeholder="Days"
          />
          <TextInput
              style={styles.input}
              placeholder="Program Name"
          />
</Form>

It is a pretty simple package so I am not sure where the issue is happening? Here is what versions I am using in my project.

"react-native": "^0.55.4", "react": "^16.4.0", "react-native-autofocus": "0.0.6"

elemnus commented 6 years ago

I'm not experiencing any problems like that even with a numeric keyboardType. I guess, it's your default keyboard app on your device. Here's my version: "react-native": "0.55.0", "react-native-autofocus": "^0.0.7","react": "16.3.0-alpha.0"