Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboardavoidingview not working properly with TextInput Password Field #23818

Closed
hussainahmad opened this issue Mar 8, 2019 · 6 comments
Closed
Labels
API: Keyboard Bug Component: KeyboardAvoidingView Component: TextInput Related to the TextInput component. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@hussainahmad
Copy link

🐛 Bug Report

When we make TextInput as a password fields KeyboardAvoidingView not work as expected.
Currently when remove secureTextEntry={true} it works fine like when I press next button on keyboard it will go to password textInput field from State textInput field and also password textInput field scroll up and works perfectly, but when I added secureTextEntry={true} which is mandatory this is not working for password fields, working fine on other fields perfectly. I also created a demo code, Please look into this. This issue is only in Android.

53394742-fd245980-39c1-11e9-9734-035712d6c2ae

To Reproduce

I made a demo code to check this issue, just remove secureTextEntry={true} from Password Fields This issue will arise only in android,

Expected Behavior

When I press next on keyboard it should go to password field and password field should scroll up like other Input Fields.

Code Example

Demo Code having Issue
Question on StackOverflow

Environment

software version
android 8.0.1
react-native 0.57.1
node 8.12.0
npm 6.4.1
expo sdk 32.0.0
@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@JKCooper2
Copy link

Unable to repro using example: https://snack.expo.io/@jkcooper/rn23818-keyboardavoidingview-android-autoscroll

On Android the KeyboardAvoidingView will only scroll when starting to type (not on focus), regardless of whether secureTextEntry is enabled. There are differences between how KeyboardAvoidingView works based on the platform as noted in the docs (https://facebook.github.io/react-native/docs/keyboardavoidingview#behavior).

Unfortunately I wasn't able to figure out how to get the behaviour you were looking for, but this may be a better question somewhere like Reactiflux (https://www.reactiflux.com/)

@hussainahmad
Copy link
Author

Hi @JKCooper2 Thanks

On Android the KeyboardAvoidingView will only scroll when starting to type (not on focus) regardless of whether secureTextEntry is enabled.

I am sure you are right but now please look into this code https://snack.expo.io/S1DzLq7PE . using TextInput of react-native-paper if I disable secureTextEntry then it works fine with Password fields.

@dulmandakh dulmandakh added the Platform: Android Android applications. label Mar 17, 2019
@dulmandakh
Copy link
Contributor

I couldn't reproduce the issue on RN 0.59, or I can click next and go to a next field even if it has secureTextEntry={true}

Hello there 👋 this issue has been reported for an old version of React Native. Ideally we'd like everyone to be using 0.59 (see the awesome changes it brought) but we know updating can be a pain. We are going to close this issue because it's from a version before 0.57, which is really old.

But please, if it's actually still an issue with 0.59 please comment below and we can reopen it. Even better, please send us a pull request with a fix 😊

@hussainahmad
Copy link
Author

hussainahmad commented Mar 20, 2019

I couldn't reproduce the issue on RN 0.59, or I can click next and go to a next field even if it has secureTextEntry={true}

@dulmandakh yes you are right it go to the next field this is not the issue. I tried with RN 0.59.1 but Issue I am discussing here not fixed , I am sure you didn't understand my context or may be I am explaining in a wrong way.
AS @JKCooper2 mentioned

On Android the KeyboardAvoidingView will only scroll when starting to type (not on focus), regardless of whether secureTextEntry is enabled.

I think in android too keyboard should scroll when click next before we start type

@ironhide0396
Copy link

Hi , I am facing the same issue as exactly mentioned by @hussainahmad . The error does occur in 0.59 too . One way i fixed it was to wrap the KeyBoardAvoidingView inside a ScrollView.
Let me know if that works out .

@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Keyboard Bug Component: KeyboardAvoidingView Component: TextInput Related to the TextInput component. Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants