1

I want to allow the user to touch anywhere on the screen to dismiss the keyboard, but still allow interaction with Buttons. My code looks something like:

<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
    <View>
        <Button onPress={...} />
    </View>
</TouchableWithoutFeedback>

Now, when I press on the button, the keyboard dimisses, but the button's onPress event doesn't fire. Is there a way to allow touchable components to respond while being wrapped in TouchableWithoutFeedback or a better way to dismiss the keyboard when touching the screen?

0 Answers0