Skip to content

[HOLD for payment 2023-07-14] Web - First cell of magic input field is not focused on clicking 'Didn't receive a magic code' link #22258

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!


Action Performed:

Action Performed:

  1. Navigate to staging sign-in page
  2. Enter email > click on continue
  3. Wait for the 30 second time out to finish
  4. Enter wrong magic code
  5. Click on 'Didn't receive a magic code' link

Expected Result:

The first cell of the magic code input field should be focused

Actual Result:

The first cell of the magic code input field is not focused

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.36-4
Reproducible in staging?: y
Reproducible in production?: n
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

Screencast.from.2023-07-05.13-57-21.mp4
Recording.3417.mp4

Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688554945270799

View all open jobs on GitHub

Activity

  1. OSBotify commented on Jul 5, 2023

    @OSBotify
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  2. melvin-bot commented on Jul 5, 2023

    @melvin-bot

    Triggered auto assignment to @MariaHCD (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  3. samh-nl commented on Jul 5, 2023

    @samh-nl
    Contributor

    Proposal

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

    The first cell of the magic input is not focused upon resending the code.

    What is the root cause of that problem?

    The input focus is not restored in the resendValidateCode function:

    const resendValidateCode = () => {
    setTwoFactorAuthCode('');
    setFormError({});
    setValidateCode('');
    User.resendValidateCode(props.credentials.login, true);
    // Give feedback to the user to let them know the email was sent so they don't spam the button.
    setTimeRemaining(30);
    };

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

    The focus should be restored by calling inputValidateCodeRef.current.focus() in BaseValidateCodeForm upon resending the code.

    What alternative solutions did you explore? (Optional)

    N/A

  4. MariaHCD commented on Jul 5, 2023

    @MariaHCD
    Contributor

    Looking to see if this is related to #21724

  5. rushatgabhane commented on Jul 5, 2023

    @rushatgabhane
    Member

    Hi @MariaHCD, I don't think this is a bug.

    It's the expected result. After a failed validation, we decided to blur the input in #20169 (comment).

  6. rushatgabhane commented on Jul 5, 2023

    @rushatgabhane
    Member

    Regardless, focusing the first cell isn't a good idea. Because if you type one single number it'll auto-submit because you have 6 digits in the input. What do you think?

  7. MariaHCD commented on Jul 5, 2023

    @MariaHCD
    Contributor

    After a failed validation, we decided to blur the input

    In this case, there was no failed validation. The user just requested for a new code.

    Because if you type one single number it'll auto-submit because you have 6 digits in the input

    Oh, interesting. Why does it auto-submit when only a single digit has been entered?

  8. HezekielT commented on Jul 5, 2023

    @HezekielT
    Contributor

    @rushatgabhane I can address this issue by changing the if condition in my PR to

    if (!(inputValidateCodeRef.current && hasError && (props.session.autoAuthState === CONST.AUTO_AUTH_STATE.FAILED || props.account.isLoading))) {
                return;
            }
    

    I limited the hasError only to props.session.autoAuthState that is why this issue is occuring should I change my pr? @MariaHCD

  9. rushatgabhane commented on Jul 5, 2023

    @rushatgabhane
    Member

    @MariaHCD sorry, I misunderstood this issue.

    The steps to get this bug are -

    1. Get an error by submitting wrong code
    2. Click resend code

    Expected: input is cleared and focused
    Actual: input is cleared and blurred

  10. 39 remaining items

  11. MariaHCD commented on Jul 10, 2023

    @MariaHCD
    Contributor

    Nice catch, @HezekielT! Updated.

  12. zanyrenney commented on Jul 14, 2023

    @zanyrenney
    Contributor

    Added the issue for the regression test.

  13. zanyrenney commented on Jul 17, 2023

    @zanyrenney
    Contributor

    #22258 (comment) as per this comment, creating an upwork job specifically for reporting bonus.

  14. zanyrenney commented on Jul 17, 2023

    @zanyrenney
    Contributor
  15. Natnael-Guchima commented on Jul 17, 2023

    @Natnael-Guchima

    Invited you: https://www.upwork.com/jobs/~011861274c564ee819 @Natnael-Guchima

    I have applied to the job. Thanks @zanyrenney

  16. zanyrenney commented on Jul 18, 2023

    @zanyrenney
    Contributor

    Offer sent!

  17. Natnael-Guchima commented on Jul 18, 2023

    @Natnael-Guchima

    Accepted the offer. Thank you.

  18. zanyrenney commented on Jul 18, 2023

    @zanyrenney
    Contributor

    That is all paid!

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.DailyKSv2Engineering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions