Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.48k stars 2.84k forks source link

[$250] keyboard hides unexpectedly when adding a new task on the report screen #50442

Open m-natarajan opened 1 week ago

m-natarajan commented 1 week ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.46-3 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @jayeshmangwani Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1728308186934659

Action Performed:

  1. Go to any chat and add a new task. (keyboard should open at this point)
  2. Tap on the newly created task to view task details.
  3. Check the composer.

    Expected Result:

    Keyboard should remain open when viewing the task details.

Actual Result:

Composer is shown as active, but the keyboard is hidden.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

Screenshots/Videos

https://github.com/user-attachments/assets/5b355b93-c1b0-4690-b0c5-a4777a2f0ead

https://github.com/user-attachments/assets/9c089ddb-e595-425f-b4be-96d690c5e07d

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021844835682397684717
  • Upwork Job ID: 1844835682397684717
  • Last Price Increase: 2024-10-18
melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @johncschuster (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

QichenZhu commented 1 week ago

Proposal

Please re-state the problem that we are trying to solve in this issue.

Tapping a task on the report screen while the soft keyboard is open will close the keyboard.

What is the root cause of that problem?

The soft keyboard is closed during the screen transition by the two pieces of code below.

https://github.com/react-navigation/react-navigation/blob/4caf3cb849a8708a36d0dbf22dac432d2ca780be/packages/stack/src/utils/useKeyboardManager.tsx#L51

Screenshot 2024-10-10 at 1 54 19 AM

https://github.com/Expensify/App/blob/1c0d2fa378ca4bac2a56489be9beaded89d3d993/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx#L663

What changes do you think we should make in order to solve the problem?

We don't need to pass the autoFocus attribute to the Android native input since useAutoFocusInput will take care of it after the screen transaction ends.

const isAndroidNative = getPlatform() === CONST.PLATFORM.ANDROID;

https://github.com/Expensify/App/blob/1c0d2fa378ca4bac2a56489be9beaded89d3d993/src/components/Composer/index.native.tsx#L127

autoFocus={isAndroidNative ? undefined : autoFocus}

What alternative solutions did you explore? (Optional)

We could consider disabling auto focus for the task details screen, just like we did for the money request details screen below.

https://github.com/Expensify/App/blob/1c0d2fa378ca4bac2a56489be9beaded89d3d993/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx#L302-L307

melvin-bot[bot] commented 1 week ago

@johncschuster Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 1 week ago

Job added to Upwork: https://www.upwork.com/jobs/~021844835682397684717

melvin-bot[bot] commented 1 week ago

Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr (External)

QichenZhu commented 1 week ago

UPDATE: My proposal doesn’t apply to the latest main.

showSoftInputOnFocus is set to false on purpose to fix https://github.com/Expensify/App/issues/10731, so it’s expected that the soft keyboard doesn’t show.

UPDATE 2: My proposal is valid again since PR https://github.com/Expensify/App/pull/50279 is reverted.

melvin-bot[bot] commented 5 days ago

@johncschuster, @mollfpr Whoops! This issue is 2 days overdue. Let's get this updated quick!

johncschuster commented 4 days ago

Looks like we're still waiting on proposals

johncschuster commented 3 days ago

Bump for Melv

melvin-bot[bot] commented 2 days ago

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸