I have 3 different textinput, textinput1, textinput2 and textinput 3.
I want that when i click on textinput1 that his bordercolor be blue, i did that and works.
What i want now is, when i click on textinput2 to textinput1 be back to his orignal color and the textinput2 be blue now.
Example on the photo.
This is my code:
state = { isFocused: true };
onFocusChange = () => {
this.setState({ isFocused: false });
}
render() {
return (
<View style={styles.container}>
<Text style={styles.headline}>Website ou App</Text>
//TEXTINPUT1
<TextInput
onFocus={this.onFocusChange}
style={(this.state.isFocused) ? {marginTop: 5, height: 40, borderWidth: 2, borderRadius: 5, borderColor: 'gray'} : {marginTop: 5, height: 40, borderWidth: 2, borderRadius: 5, borderColor: '#00b7eb'}}
onChangeText={(text) => this.setState({ site: text })}
value={this.state.site}
//TEXTINPUT2
<Text style={styles.headline}>Utilizador/Email</Text>
<TextInput
style={{ marginTop: 5, height: 40, borderColor: 'gray', borderWidth: 1 }}
onChangeText={(text) => this.setState({ local: text })}
value={this.state.local}
/>
Some idea how i can do that? Thank you.
