I have two forms in react-native. One of the works perfectly, the other (in another component) has a bug. The TextInput
s in the form keep blurring when getting focus.
The video I made (see gif below) shows that whenever I click in the input it gets focus and then immediately blurs right after it.
The code for the input (now with debugs):
<TextInput value={group.name}
blurOnSubmit={false}
onBlur={() => console.log('I blur')}
onFocus={() => console.log('I focus')}
autoFocus={true} style={styles.textInput} />
I found the answer... and I am confused as to why it is the answer, but here we go:
Apparently when you render a TextInput
inside of a TabBarIOS
component and you set selected={true}
on your tab it will make it impossible to type into the TextInputs. I have no idea why. I had this on true
in order to not have to click on the tab every time while building my views. I guess I will just set the default differently then :)