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.42k stars 2.8k forks source link

Android - Invoice - In invoice details page, reopening amount field shows cursor at beginning #50055

Open lanitochka17 opened 1 day ago

lanitochka17 commented 1 day 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.43-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Launch app
  2. Log in with new expensifail account
  3. Tap fab -- new workspace - more features - enable invoice
  4. Navigate to LHN
  5. Tap fab - send invoice
  6. Enter an amount and tap next
  7. Select a user
  8. Tap next
  9. Enter company name and address
  10. Tap send invoice
  11. Open invoice - amount
  12. Reopen the amount field

Expected Result:

In invoice details page, reopening amount field must not show cursor at beginning

Actual Result:

In invoice details page, reopening amount field shows cursor at beginning

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/2521a545-b9bd-4969-b404-82170b95ef48

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @situchan
melvin-bot[bot] commented 1 day ago

Triggered auto assignment to @sakluger (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.

lanitochka17 commented 1 day ago

@sakluger FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

melvin-bot[bot] commented 1 day ago

Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.

melvin-bot[bot] commented 1 day ago

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

nkdengineer commented 20 hours ago

Proposal

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

In invoice details page, reopening amount field shows cursor at beginning

What is the root cause of that problem?

The weird bug happens by the old HOC withOnyx in IOURequestStepAmount. That causes the currency to flicker from USD to the current currency

https://github.com/user-attachments/assets/72b281ec-0320-4195-b49f-da77feecfada

https://github.com/Expensify/App/blob/efa3274237e9da1d4fdcea10db8f04458a3105e8/src/pages/iou/request/step/IOURequestStepAmount.tsx#L334

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

Remove withOnyx in IOURequestStepAmount and use useOnyx. The test branch here

https://github.com/Expensify/App/blob/efa3274237e9da1d4fdcea10db8f04458a3105e8/src/pages/iou/request/step/IOURequestStepAmount.tsx#L334

What alternative solutions did you explore? (Optional)

Result

https://github.com/user-attachments/assets/205fd6c0-b888-4e0d-86e8-aea7aec3e84d

situchan commented 6 hours ago

@nkdengineer thanks for the proposal. The root cause is not clear. Please explain why this bug happens only on android. I tested your branch and bug is still reproducible.