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] mWeb - Login - Magic code isn't auto focused, the keypad isn't active #32802

Closed
1 of 6 tasks
kbecciv opened this issue Dec 11, 2023 · 13 comments
Closed
1 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 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

Comments

@kbecciv
Copy link

kbecciv commented Dec 11, 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!


Version Number: 1.4.10.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:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Tap on the "Continue" button after filling email address

Expected Result:

The keypad should be visible.

Actual Result:

Magic code isn't auto focused, the keypad isn't active.

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6308759_1702294847870.Nelm2455_1_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~017a66c8bbd9584d64
  • Upwork Job ID: 1734195427457425408
  • Last Price Increase: 2023-12-18
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Dec 11, 2023
@melvin-bot melvin-bot bot changed the title mWeb - Login - Magic code isn't auto focused, the keypad isn't active [$500] mWeb - Login - Magic code isn't auto focused, the keypad isn't active Dec 11, 2023
Copy link

melvin-bot bot commented Dec 11, 2023

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

Copy link

melvin-bot bot commented Dec 11, 2023

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

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

melvin-bot bot commented Dec 11, 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

Copy link

melvin-bot bot commented Dec 11, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Dec 11, 2023

Proposal

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

Magic code isn't auto focused, the keypad isn't active.

What is the root cause of that problem?

iOS Safari only allows automatic focus on input to open keyboard after user interaction.

But in here, we only show the ValidateCodeForm after the user clicks on Continue and we load the new login state.

This means the ValidateCodeForm and automatic magic code input focus happens in a different event loop as the user interaction, and the input is focused but the keyboard will not open.

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

We need to use the same pattern as we did here with the LoginForm. The ValidateCodeForm will always be rendered, but invisible. We only let it be visible with the same conditions we're currently using to decide whether or not to show it.

This will make the ValidateCodeForm magic code input focus happens at the same event loop as the user interaction and the keyboard will show.

What alternative solutions did you explore? (Optional)

We should double check other forms and apply similar fix, the same issue may occur for other forms.

@beingforthebenefit
Copy link

beingforthebenefit commented Dec 11, 2023

Proposal

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

Users on iOS Safari are experiencing an issue where the magic code input in the ValidateCodeForm does not automatically focus, preventing the keypad from activating automatically. This issue affects user experience by requiring additional manual input, which should ideally be automated.

What is the root cause of that problem?

iOS Safari has a specific requirement for triggering keyboard visibility – the input focus operation must occur within the same event loop as a user interaction. Our current implementation of ValidateCodeForm does not align the focus event with this requirement, leading to the described issue.

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

  • Set autoFocus Property on MagicCodeInput:

    • Modify the <MagicCodeInput /> component within BaseValidateCodeForm to include the autoFocus property set to true. This change aims to focus the input field automatically when the form is rendered.
  • Adjust useFocusEffect Hook:

    • Introduce a setTimeout with a delay of 0 in the useFocusEffect hook. This adjustment defers the focus operation to the next event loop, aligning it with iOS Safari's requirements.
    • Code change involves wrapping the focus method call inside a setTimeout function.

What alternative solutions did you explore? (Optional)

  • Considered using platform-specific code to target iOS devices, but this could lead to fragmented codebase and maintenance challenges.
  • Explored different lifecycle methods and hooks to manage focus but found the proposed solution to be the most straightforward and least intrusive.

Copy link

melvin-bot bot commented Dec 11, 2023

📣 @beingforthebenefit! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Make sure you've read and understood the contributing guidelines.
  2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@beingforthebenefit
Copy link

beingforthebenefit commented Dec 11, 2023

Contributor details
Your Expensify account email: gerald@gtodd.dev
Upwork Profile Link: https://www.upwork.com/freelancers/~01ffe931aad7af2ea8

Copy link

melvin-bot bot commented Dec 11, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@narefyev91
Copy link
Contributor

@sophiepintoraetz Hey! I think we already have workflow to close such kind of issues based on apple specific browser flow.
Some of those issues were closed with this #7064 (comment).
This one can be linked to master tracking issue - #10414

@narefyev91
Copy link
Contributor

Friendly ping @sophiepintoraetz

Copy link

melvin-bot bot commented Dec 18, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Dec 18, 2023
@sophiepintoraetz
Copy link
Contributor

Thanks @narefyev91 - closing and moving!

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. Daily KSv2 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
Projects
None yet
Development

No branches or pull requests

5 participants