Open KrisLau opened 2 years ago
Use TouchableWithoutFeedback
to wrap around your KeyboardAwareScrollView
and onPress of TouchableWithoutFeedback
add onPress={Keyboard.dismiss} and accessbile={false}
Note: Keyboard, TouchableWithoutFeedback needs to be imported from react-native.
Example:
<TouchableWithoutFeedback onPress={Keyboard.dismiss} accessible={false}>
<KeyboardAwareScrollView>
{your code}
</KeyboardAwareScrollView>
</TouchableWithoutFeedback>
@sikandarchishty That works but I feel like that dismissing the keyboard when tapping away should be the default behaviour
I have a
KeyboardAwareScrollView
surrounding some text inputs. When I click away from a text input, I'm hoping to dismiss the keyboard so I setkeyboardShouldPersistTaps={'handled'}
but it doesn't seem to dismiss the keyboard