React-native-keyboard-aware-scroll-view: keyboardShouldPersistTaps="never" doesn't dismiss keyboard between TextInputs

Created on 12 Apr 2018  路  3Comments  路  Source: APSL/react-native-keyboard-aware-scroll-view

I have a setup, described in this Snack.

I am using a KeyboardAwareScrollView with keyboardShouldPersistTaps="never", so that a click away from a form input always dismisses the keyboard. If I press into one of the text inputs, and then press outside of it, the keyboard dismisses as is expected. If I press into one of the text inputs, and then immediately into another, I can then not immediately dismiss the keyboard.

As I am also using react-native-modal-selector, this means that a user is able to launch a modal for a choice list, and when they choose an item, they are returned back to the previous field with the focus, and the keyboard open.

Should keyboardShouldPersistTaps="never" mean that even taps between text inputs should dismiss the keyboard?

I am using:

    "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
    "react-native-keyboard-aware-scroll-view": "^0.5.0",
Upstream issue

Most helpful comment

I am experiencing the same thing. I changed it to keyboardShouldPersistTaps="handled" and now the keyboard is dismissing correctly, even after selecting a second input. I haven't gotten far enough to see if there are other side effects to using "handled".

All 3 comments

I am experiencing the same thing. I changed it to keyboardShouldPersistTaps="handled" and now the keyboard is dismissing correctly, even after selecting a second input. I haven't gotten far enough to see if there are other side effects to using "handled".

I experienced this too. keyboardShouldPersistTaps="handled" solved the issue. Thanks.

Turns out this bug is coming from upstream - https://github.com/facebook/react-native/issues/17252

Was this page helpful?
0 / 5 - 0 ratings