Using TextInputs in carousel slides: need a way to handle touch events while keyboard is open
See original GitHub issueIs 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 ([]
).)
- I have read the guidelines regarding bug report.
- I have reviewed the documentation in its entirety, including the dedicated documentation 📚.
- I have searched for existing issues and made sure that the problem hasn’t already been reported.
- I am using the latest plugin version.
- I am following the issue template closely in order to produce a useful bug report.
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
- Enter some text into the text input
- Click the button WHILE the keyboard is open
- Issue is exposing, as first the text input gets unfocused
Thank you for your time in advance, and your great library!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (1 by maintainers)
Top GitHub Comments
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.it worked for me just adding
keyboardShouldPersistTaps='handled'