Goal
I need users to be able to press up to 4 buttons at the same time in React Native.
Current Roadblock
I'm using TouchableHighlight and when one button is pressed, none of the other 3 buttons can be pressed by the user.
Code
This is the function I'm using to display each of the 4 coloured quadrants you see below. If including more code will be helpful, just let me know!
return (
<TouchableOpacity
style={[styles.button, styles[color]]}
onPress={() => {
EventRegister.emit('firstPressed', color);
EventRegister.removeEventListener(this.listener);
this.setState({[color]: true});
}}
disabled={this.state[color]}></TouchableOpacity>
);
};
Screenshot
This is a screenshot of the app where once the countdown clock gets to zero, 4 players race to push each button as quickly as they can (it's an iPad app so they have a large playing surface). Each player needs to receive feedback from their touch or they will think they lost because the app didn't recognize their input.