React-native-snap-carousel: Using TextInputs in carousel slides: need a way to handle touch events while keyboard is open

Created on 20 Aug 2019  路  6Comments  路  Source: meliorence/react-native-snap-carousel

Is this a bug report, a feature request, or a question?

Question

I am using e.g. this great carousel library for a signup form. I have multiple TextInput within these forms, that gets rendered to the carousel sliders. When entering text and clicking a submit button it needs at least two clicks, as first, the text view gets unfocused. So basically, we need a feature that allows us to handle TouchEvents while the keyboard is open.
I know that we have for ScrollView this KeyboardShouldPersistTaps Prop to alternate this behaviour. I think something similar in this library would be great! 馃槉

See my expo snack below for an example.

Have you followed the required steps before opening a bug report?

(Check the step you've followed - put an x character between the square brackets ([]).)

Have you made sure that it wasn't a React Native bug?

Yes

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

Both

Is the bug reproductible in a production environment (not a debug one)?

Yes it is

Environment

React: 16.8.3
React native: 0.59.8
react-native-snap-carousel: 3.8.0

Target Platform:
Android (6.0)
iOS (12.4)

Expected Behavior

You can click the button while the keyboard is open.
The TextInput gets unfocused AND the button gets clicked (/the other touch events are getting handled).

Actual Behavior

It needs at least two clicks to trigger the button

Reproducible Demo

https://snack.expo.io/@hannojg/rn-carousel-input-issue

Steps to Reproduce

  1. Enter some text into the text input
  2. Click the button WHILE the keyboard is open
  3. Issue is exposing, as first the text input gets unfocused

Thank you for your time in advance, and your great library!

Most helpful comment

Hi @hannojg,

Have you tried using prop keyboardShouldPersistTaps on the carousel itself?

It should work the same as with a regular ScrollView. See this if you want more info.

All 6 comments

Hello,
I don't want to annoy, but is it possible to let me know the stage this issue is in?
Thank you!

Hi @hannojg,

Have you tried using prop keyboardShouldPersistTaps on the carousel itself?

It should work the same as with a regular ScrollView. See this if you want more info.

Hi all, any updates?
keyboardShouldPersistTaps not helped :(

it worked for me just adding keyboardShouldPersistTaps='handled'

<Carousel
keyboardShouldPersistTaps='handled'
...
/>

use keyboardShouldPersistTaps = {true} as a prop in

keyboardShouldPersistTaps = {true} is deprecated, keyboardShouldPersistTaps = "always" did the trick for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KarlosQ picture KarlosQ  路  4Comments

niloufarMakhzani picture niloufarMakhzani  路  4Comments

Murena7 picture Murena7  路  3Comments

wkwyatt picture wkwyatt  路  4Comments

Dr1992 picture Dr1992  路  4Comments