Skip to content

[HOLD for payment 2023-05-16] [$1000] Request/Split/Send - There is NO cursor in the description input field #17579

Closed

Description

@kbecciv

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


**Issue found when executing PR ** #16919

Action Performed:

  1. Go to URL https://staging.new.expensify.com/
  2. Login with any account
  3. Click on the FAB button -> Send money
  4. Select an amount, and recipient and get to the final confirmation page
  5. Click on the description

Expected Result:

There is a cursor in the description input field

Actual Result:

There is NO cursor in the description input field

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.1.0

Reproducible in staging?: Yes

Reproducible in production?: New feature

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

Bug6022399_Recording__4211.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team / @Natnael-Guchima

Slack conversation:
https://expensify.slack.com/archives/C049HHMV9SM/p1681775845071829
View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c4252f7d1c570de7
  • Upwork Job ID: 1649500398080548864
  • Last Price Increase: 2023-04-28

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Apr 18, 2023
  2. MelvinBot commented on Apr 18, 2023

    @MelvinBot
    Contributor

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

  3. MelvinBot commented on Apr 18, 2023

    @MelvinBot
    Contributor

    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
  4. changed the title [-]REquest/Split/Send - There is NO cursor in the description input field[/-] [+]Request/Split/Send - There is NO cursor in the description input field[/+] on Apr 18, 2023
  5. allroundexperts commented on Apr 18, 2023

    @allroundexperts
    Contributor

    Proposal

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

    Request/Split/Send - There is NO cursor in the description input field

    What is the root cause of that problem?

    The root cause of this issue is that we do not have the autoFocus property set on the input here.

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

    We can add autoFocus property to the text input here.

    However, as mentioned by @tienifr in his proposal, adding a plain autofocus property would sometimes cause the field to be focused without the keyboard being opened in Android. We thus need to apply the autoFocus property only after the screen transition is complete. This can be done simply by providing a callback to the ScreenWrapper component that focuses the input once the transition is complete. This is currently done at several places right now and adding this here again would be a clear violation of the DRY principle.

    We can remove this logic by creating a Context that wraps the ScreenWrapper here. It will look like the following:

                <ScreenWrapperContext.Provider didScreenTransitionEnd={this.state.didScreenTransitionEnd}>
                          .
                          .
                          .
                </ScreenWrapperContext.Provider>
    
    

    Then we can use the above context in the TextInput component and focus only if the didScreenTransitionEnd is true. This logic can be added here:

        componentDidUpdate(prevProps) {
            if (prevProps.didScreenTransitionEnd) {
                return;
            }
    
            if (this.props.didScreenTransitionEnd) {
                this.textInput.focus();
            }
        }
    

    We'll need to create a HOC that consumes the ScreenWrapperContext and injects the value of the context inside the TextInput component.

    By using the above approach, we'll essentially make sure that the TextInput auto focus in Android is fixed once and for all.

    What alternative solutions did you explore? (Optional)

    None

  6. arielgreen commented on Apr 21, 2023

    @arielgreen
    Contributor

    Reproduced, I agree that we should have the cursor automatically in the description field here.

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Apr 21, 2023
  8. changed the title [-]Request/Split/Send - There is NO cursor in the description input field[/-] [+][$1000] Request/Split/Send - There is NO cursor in the description input field[/+] on Apr 21, 2023
  9. MelvinBot commented on Apr 21, 2023

    @MelvinBot
    Contributor
  10. MelvinBot commented on Apr 21, 2023

    @MelvinBot
    Contributor

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

  11. 63 remaining items

  12. Natnael-Guchima commented on May 11, 2023

    @Natnael-Guchima

    @Natnael-Guchima excellent, offer sent.

    Accepted. Thanks, @arielgreen.

  13. situchan commented on May 11, 2023

    @situchan
    Contributor

    I suggest to fix all auto-focus issues in one GH and in BZ checklist stage, add it to PR checklist along with trim when we implement new page with text inputs. There are many minor issues currently reported related to autofocus, trim. i.e. autofocus: #17579 #17714 #17833 trim: #17663 #17770 #17485 All of these are came from NewContactMethodPage, MoneyRequestDescriptionPage implementation. cc: @cristipaval @yuwenmemon

    Edit: Another trim issue: #17725

    Just a reminder to add these to PR checklist I suggest.
    Especially, auto-focus issues keep growing. They are easily missed when implement new pages
    i.e. #18660 #18371

  14. arielgreen commented on May 17, 2023

    @arielgreen
    Contributor

    Calculating payments:

    1 business days = 50% bonus

    $500 to @Natnael-Guchima
    $1000 + 50% = $1500 to @tienifr
    $1000 + 50% = $1500 to @sobitneupane

    All payments have been issued.

  15. arielgreen commented on May 17, 2023

    @arielgreen
    Contributor

    @sobitneupane can you please review and complete the checklist? Once that's done we are good to close this.

  16. sobitneupane commented on May 17, 2023

    @sobitneupane
    Contributor

    BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

    • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

    #16919

    • [@sobitneupane] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:

    #16919 (comment)

  17. sobitneupane commented on May 17, 2023

    @sobitneupane
    Contributor

    We have an issue on mWeb/Safari (reproducible only on real device). Those issues exists in these places. @tgolen had suggested all those cases to be handled here. I am little confused on the next step now.

  18. tgolen commented on May 19, 2023

    @tgolen
    Contributor

    Ah, so it looks like none of those other places were fixed in the current PR (I kinda forgot about them). At this point, we'll need to open up a new issue to have those other places fixed.

  19. tgolen commented on May 22, 2023

    @tgolen
    Contributor

    @kbecciv How do you want to handle fixing the other places?

  20. arielgreen commented on May 23, 2023

    @arielgreen
    Contributor

    Discussing in Slack here.

  21. arielgreen commented on May 25, 2023

    @arielgreen
    Contributor

    Creating a new issue for this, we're done here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions