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

Manually handle keyboard to prevent Android crash #2707

Merged
merged 2 commits into from
May 7, 2021

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented May 5, 2021

Details

Fix Android crash due to automatic handling of software keyboard

Fixed Issues

Fixes #2694

Tests

QA Steps

Repeat steps in linked issue...

  1. Launch the app
  2. Log in with expensifail account
  3. Select any user
  4. Click on Plus button and select Request Money
  5. Put any amount and Click Next
  6. In Field What's it for? - put some text (make sure the software keyboard is displayed)
  7. Tap on back arrow
  8. Verify the Android app does not crash.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this May 5, 2021
@marcaaron marcaaron marked this pull request as ready for review May 5, 2021 23:17
@marcaaron marcaaron requested a review from a team as a code owner May 5, 2021 23:17
@MelvinBot MelvinBot requested review from ctkochan22 and removed request for a team May 5, 2021 23:17
@marcaaron marcaaron requested a review from Julesssss May 5, 2021 23:18
@marcaaron
Copy link
Contributor Author

cc @Julesssss since I think you might be interested in this fix.

Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the on screen keyboard will NOT automatically dismiss when navigating to a new screen. Defaults to true.

This is working nicely. Given that we are adding the flag to the main nav stack I was worried that the soft keyboard would remain open when navigating to Screens with no input fields (this happens with native Android if you remove the auto-handling and don't manually close the soft keyboard) -- but this doesn't seem to be happening...

This is great, but I'm a bit confused as to why this is -- something must be telling the keyboard to hide and I would love to know what that is (behavior that we've declared elsewhere, or maybe default RN handling that occurs if the screen contains no input?). It's not important enough to block the merge and I don't have the time to investigate the RN/navigation code, but please let me know if you have any theories!

@marcaaron
Copy link
Contributor Author

something must be telling the keyboard to hide and I would love to know what that is (behavior that we've declared elsewhere, or maybe default RN handling that occurs if the screen contains no input?)

react-navigation was telling it to hide, but now it just hides when the input is unmounted would be my best guess.

@marcaaron
Copy link
Contributor Author

all yours @ctkochan22

@ctkochan22 ctkochan22 merged commit 87d4ac3 into main May 7, 2021
@ctkochan22 ctkochan22 deleted the marcaaron-fixAndroidCrash branch May 7, 2021 00:40
@OSBotify
Copy link
Contributor

OSBotify commented May 7, 2021

🚀 Deployed to staging in version: 1.0.39-1🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented May 8, 2021

🚀 Deployed to production in version: 1.0.39-5🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android - App crashes when tapping back arrow on request money screen
4 participants