React-native: Android: screen not resizing when shifting focus to next empty TextInput

Created on 24 Dec 2017  路  12Comments  路  Source: facebook/react-native

Is this a bug report?

YES

Have you read the Contributing Guidelines?

YES

Environment

Environment:
OS: macOS High Sierra 10.13.2
Node: 8.9.1
Yarn: 1.3.2
npm: 5.5.1
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0 => 0.51.0

Target Platform: Android

Steps to Reproduce

  1. Create a blank react-native app and add a scrollview with 7-8 TextInput inside it. (just making sure some of the input will be under keyboard when it shows up)
  2. For the bottom inputs, add blurOnSubmit={false} and onSubmitEditing to focus to the next input when submitting. Example: (Notice the last input value is empty.)
<TextInput
  ref={(r) => { this.pqr = r; }}
  blurOnSubmit={false}
  onSubmitEditing={() => { this.stu.focus(); }}
  value='pqr'
  onChangeText={() => null}
  returnKeyType='next'
/>
<TextInput
  ref={(r) => { this.stu = r; }}
  blurOnSubmit={false}
  onSubmitEditing={() => { this.vwx.focus(); }}
  value='stu'
  onChangeText={() => null}
  returnKeyType='next'
/>
<TextInput
  ref={(r) => { this.vwx = r; }}
  value=''
  onChangeText={() => null}
  returnKeyType='go'
/>
  1. Now focus the input which has a value pqr and press 'Next' from keyboard. Screen will push up the next input which has a value set to stu. Now press 'Next' again, in this case screen doesn't push up the next input because it's value is empty.

Expected Behavior

Next input should be pushed up by screen

Actual Behavior

Next input (ref vwx) is not getting pushed up above the keyboard cause it's initial value is empty.

Demo

input_bug

Bug TextInput Android Ran Commands Stale

Most helpful comment

I found the solution can you take a look @hramos Pull request

All 12 comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Reproducible on react 16.3 / react-native 0.53.3

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

This is still happening on RN 0.55.4, I didn't have a chance to look for a fix. Hopefully someone else will find a solution and post it here, so that everyone can benefit from it.

Still happening on RN 0.57.1. ScrollView don't focus on empty input, more examples:

focus

Expo example

@hramos any update?

Still happening. any solution ?

No update on my part. If there is a pull request that fixes this issue, let me know so we can take a look.

I found the solution can you take a look @hramos Pull request

@hramos can you remove the PR Submitted tag? The submitted PR was rejected.

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DreySkee picture DreySkee  路  3Comments

aniss picture aniss  路  3Comments

axelg12 picture axelg12  路  3Comments

jlongster picture jlongster  路  3Comments

ghost picture ghost  路  3Comments