I am working on Android TV application where i want focus on button (Submit) when done button click of keyboard for second TextInput.
please help How to focus on button from second textInput using onSubmiteEditing for React native Android TV.
<View style={{flexDirection:'column',alignItems:'center'}} keyboardShouldPersistTaps="handled">
<TouchableHighlight
onPress={()=>InputTextRef.current.focus()}
onFocus={()=>{
InputTextRef && InputTextRef.current.focus()
}}
// onFocus={onFocus1}
// onBlur={onBlur1}
>
<TextInput
ref={InputTextRef}
onSubmitEditing = {()=>InputTextRef2.current && InputTextRef2.current.focus()}
blurOnSubmit={false}
onChangeText={setUrls}
value={urls}
placeholder="Enter Your URL"
placeholderTextColor="#f4f3f4"
color= '#f4f3f4'
autoCorrect={false}
autoFocus={focus1 ? true :false}
onFocus={onFocus1}
onBlur={onBlur1}
style={android_tv? [styles.input, focus1 ? styles.TextInputFocused :null]:styles.input}
/>
</TouchableHighlight >
<TouchableHighlight
onPress={()=>InputTextRef2.current.focus()}
onFocus={()=>{
InputTextRef2 && InputTextRef2.current.focus()
}}
// onFocus={onFocus2}
// onBlur={onBlur2}
>
<TextInput
ref={InputTextRef2}
onSubmitEditing = {()=>btnref.current.focus()}
// onEndEditing = {()=> btnref.current.focus()}
blurOnSubmit={false}
onChangeText={setKeys}
value={keys}
placeholder="Enter Your Account Id"
placeholderTextColor="#f4f3f4"
color= '#f4f3f4'
autoCorrect={false}
autoFocus= {focus2 ? true :false}
onFocus={onFocus2}
onBlur={onBlur2}
style={android_tv?[styles.input, focus2 ? styles.TextInputFocused :null]:styles.input}
/>
</TouchableHighlight >
<TouchableHighlight
onFocus={onFocus}
onBlur={onBlur}
ref={btnref}
// hasTVPreferredFocus={ btnref ? true : false}
style={[ styles.search , focus ? styles.wrapperFocused :null]}
onPress= {handleSearchButton}>
<Text style={ android_tv ? styles.watchtext1 : styles.watchtext2 }>Submit</Text>
</TouchableHighlight>
</View>
In above code , i have two input field and one submit button. i want focus on submit button after second textinput using keyboard next(right sign) key.