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

[$500] Request Money - Search focus appear on flash and than disappear when user click change currency #27030

Closed
3 of 6 tasks
lanitochka17 opened this issue Sep 8, 2023 · 13 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 8, 2023

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


Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Click FAB button
  3. Select Request money
  4. Click on Currency

Expected Result:

Search field should be focused so user can search for a currency

Actual Result:

Search focus appear on flash and than disappear

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • Windows / Chrome
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.66-1

Reproducible in staging?: Yes

Reproducible in production?: Yes

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6192832_Recording__929.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c48747135456f06b
  • Upwork Job ID: 1701054339692290048
  • Last Price Increase: 2023-09-11
@lanitochka17 lanitochka17 added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Triggered auto assignment to @sophiepintoraetz (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@abdel-h66
Copy link
Contributor

abdel-h66 commented Sep 9, 2023

Proposal

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

The search text input is focused briefly right after the section is opened and then loses focus.

What is the root cause of that problem?

It seems to be a strange issue, while the same currency selector works just fine on the Split Bill tab, it does lose the focus when used on the Request Money tab.

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

Delaying the focus seems to solve the issue, without introducing any regressions, by setting the prop shouldDelayFocus to true.

https://github.com/Expensify/App/blob/b11bddc054f54bb46d5fb5aaf05e25b8a7df7faf/src/pages/iou/IOUCurrencySelection.js#L137C2-L137C2

What alternative solutions did you explore? (Optional)

N/A

@jeet-dhandha
Copy link
Contributor

Proposal

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

  • IOU Currency Selection not autofocusing on the search field when the modal is opened.

What is the root cause of that problem?

  • Its focusing onto list after search field so it gets out-focused instantly.

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

  • Solution is to add shouldDelayFocus prop to below code.

<OptionsSelector
sections={sections}

What alternative solutions did you explore? (Optional)

  • N/A

@sophiepintoraetz
Copy link
Contributor

Able to reproduce
2023-09-11_14-04-44 (1)

@sophiepintoraetz sophiepintoraetz added the External Added to denote the issue can be worked on by a contributor label Sep 11, 2023
@melvin-bot melvin-bot bot changed the title Request Money - Search focus appear on flash and than disappear when user click change currency [$500] Request Money - Search focus appear on flash and than disappear when user click change currency Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

Current assignee @sophiepintoraetz is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 11, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Sep 11, 2023

Proposal

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

Search focus appear on flash and than disappear.

There's also the issue where we cannot see any screen animation to the currency screen, the screen just snaps out when we click on the currency text, there should be an animation.

What is the root cause of that problem?

It's because in OptionsSelector, we're focusing on the input immediately after rendering, without waiting for the screen transition to finish. So the input focusing will conflict with the screen transition, causing the 2 issues.

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

This has happened many times with a lot of inputs, and the standard way to fix it is to use onEntryTransitionEnd instead of relying on timeout and shouldDelayFocus (see discussion here)

So the steps are:

  1. We should expose the ref of the input of OptionsSelector so that we can access the ref inside the pages that use OptionsSelector (for example the NewChatPage)
  2. In the IOUCurrencySelection screen, use the ref to focus on the input in the onEntryTransitionEnd callback of ScreenWrapper. (other usage of OptionsSelector that has the issue can be fixed similarly)

There's a known issue with onEntryTransitionEnd where sometimes it does not fire, this is already being handled separately here so I think we don't need to worry about it in this issue (if we do, we should hold the issue until that one is done, but basically we still need to do the onEntryTransitionEnd approach).

What alternative solutions did you explore? (Optional)

NA

@tienifr
Copy link
Contributor

tienifr commented Sep 12, 2023

Really sorry for the inconvenience but I mentioned the wrong issue. Apologize again 🙇

@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@mvtglobally
Copy link

Issue not reproducible during KI retests. (Second week)

@sophiepintoraetz
Copy link
Contributor

I think I'll close this one out if it's no longer reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants