meliorence / meliorence/react-native-snap-carousel

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

Open
#565 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Expo Snack and reproduce the behavior on both platforms using the stated React Native and carousel versions. Compare the carousel's touch handling with React Native's keyboardShouldPersistTaps behavior; done means the submit button and other touch events work on the first tap while the keyboard is open, with the TextInput able to unfocus.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.