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

[Awaiting payment on 23/08/24] [$250] Pressing Tab in the magic code screen does not move to next magic code input #45416

Closed
1 of 6 tasks
m-natarajan opened this issue Jul 15, 2024 · 29 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 15, 2024

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.6-4
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: @dylanexpensify
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1721030930518949

Action Performed:

  1. Open staging.new.expensify.com
  2. Enter the email address of any account
  3. When the focus is on any of the inputs for the magic code except the last one press Tab key

Expected Result:

The cursor moves to the next input for magic code

Actual Result:

The cursor jumps to Didn't receive a magic code? if 30 sec elapses or sign in button

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

Recording.331.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01cf3849877e81009e
  • Upwork Job ID: 1818598235444042146
  • Last Price Increase: 2024-07-31
  • Automatic offers:
    • ishpaul777 | Reviewer | 103423841
Issue OwnerCurrent Issue Owner: @ishpaul777
@m-natarajan m-natarajan added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 15, 2024
Copy link

melvin-bot bot commented Jul 15, 2024

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

@m-natarajan m-natarajan changed the title when inputting magic code, pressing tab moves the cursor to Didn't receive a magic code? instead of along the code inputs Pressing Tab in the magic code screen does not move to next magic code input Jul 15, 2024
@nyomanjyotisa
Copy link
Contributor

Proposal

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

Pressing Tab in the magic code screen does not move to next magic code input

What is the root cause of that problem?

We don't handle Tab press on onKeyPress on MagicCodeInput here, so it still default behavior to move to the next element

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

Add Tab key press logic on onKeyPress on MagicCodeInput here to move to next part of the magic code input

else if (keyValue === 'Tab' && focusedIndex !== undefined) {
    const newFocusedIndex = focusedIndex + 1;
    if (newFocusedIndex !== maxLength) {
        if (event.preventDefault) {
            event.preventDefault();
        }
        setInputAndIndex(newFocusedIndex);
        inputRefs.current?.focus();
    }
}

RESULT

New-Expensify.14.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

@miljakljajic Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

Copy link

melvin-bot bot commented Jul 22, 2024

@miljakljajic Still overdue 6 days?! Let's take care of this!

Copy link

melvin-bot bot commented Jul 23, 2024

@miljakljajic 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

Copy link

melvin-bot bot commented Jul 25, 2024

@miljakljajic Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

Copy link

melvin-bot bot commented Jul 29, 2024

@miljakljajic this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Copy link

melvin-bot bot commented Jul 29, 2024

@miljakljajic 12 days overdue now... This issue's end is nigh!

@miljakljajic miljakljajic added the External Added to denote the issue can be worked on by a contributor label Jul 31, 2024
@melvin-bot melvin-bot bot changed the title Pressing Tab in the magic code screen does not move to next magic code input [$250] Pressing Tab in the magic code screen does not move to next magic code input Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jul 31, 2024
Copy link

melvin-bot bot commented Jul 31, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2024
@daledah
Copy link
Contributor

daledah commented Jul 31, 2024

Proposal

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

The cursor jumps to Didn't receive a magic code? if 30 sec elapses or sign in button

What is the root cause of that problem?

The magic code input actually has only 1 input

The 6 fields are View with manual focus highlighting behavior

{getInputPlaceholderSlots(maxLength).map((index) => (

So when tabbing, it will just move directly to buttons below.

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

We need to manually handle the tabbing behavior, just like we did for arrow keys. So in

, we can add

else if (keyValue === 'Tab' && focusedIndex !== undefined) {
    const newFocusedIndex = event.shiftKey ? focusedIndex - 1 : focusedIndex + 1;
    if (newFocusedIndex >= 0 && newFocusedIndex < maxLength) {
        setInputAndIndex(newFocusedIndex);
        inputRefs.current?.focus();
        event?.preventDefault && event.preventDefault();
    }
}

If the user presses tab, it's forward navigation and the new focused index will be the one on the right, otherwise. If the user presses shift also, it's backward tabbing and the one we should focus next would be the one on the left.

If the new index is within range, we prevent default and focus on that index, if it's not in range, that means the user wants to navigate outside of the magic code inputs and we should do nothing and let the browser handle the rest.

What alternative solutions did you explore? (Optional)

We can check and possibly handle other key combination with Tab too, ie. Ctrl + Tab should do nothing

@ishpaul777
Copy link
Contributor

ishpaul777 commented Jul 31, 2024

Thanks for your proposals @nyomanjyotisa @daledah.


Proposal from @daledah looks most complete to me, lets assign them 👍

🎀 👀 🎀

Copy link

melvin-bot bot commented Jul 31, 2024

Triggered auto assignment to @srikarparsi, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

Copy link

melvin-bot bot commented Aug 6, 2024

@miljakljajic, @srikarparsi, @ishpaul777 Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot added the Overdue label Aug 6, 2024
@ishpaul777
Copy link
Contributor

waiting for final proposal review cc @srikarparsi

@melvin-bot melvin-bot bot removed the Overdue label Aug 6, 2024
@srikarparsi
Copy link
Contributor

Looks good to me as well, thanks for the bump

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 6, 2024
Copy link

melvin-bot bot commented Aug 6, 2024

📣 @ishpaul777 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Aug 6, 2024

📣 @daledah You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 7, 2024
@daledah
Copy link
Contributor

daledah commented Aug 7, 2024

@ishpaul777 this PR is ready for review.

@miljakljajic
Copy link
Contributor

Is this one coming up for payment this week? I noticed the PR was deployed to prod, but seems like the automation has failed

@miljakljajic miljakljajic changed the title [$250] Pressing Tab in the magic code screen does not move to next magic code input [Awaiting payment on 23/08/24] [$250] Pressing Tab in the magic code screen does not move to next magic code input Aug 21, 2024
@miljakljajic miljakljajic added Daily KSv2 and removed Weekly KSv2 labels Aug 21, 2024
@srikarparsi
Copy link
Contributor

Yes, I believe so thank you @miljakljajic

@miljakljajic
Copy link
Contributor

@daledah it doesn't look like you've applied to the job on upwork. Can you please either apply or share your upwork profile so we can get an offer sent to you?

@miljakljajic
Copy link
Contributor

@ishpaul777 has been paid - we can close this out when we hear from @daledah - please share your profile or apply to the job.

Copy link

melvin-bot bot commented Aug 28, 2024

@miljakljajic, @srikarparsi, @ishpaul777, @daledah Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@ishpaul777
Copy link
Contributor

Update above melvin #45416 (comment)

@miljakljajic miljakljajic added the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 29, 2024
@daledah
Copy link
Contributor

daledah commented Aug 29, 2024

@miljakljajic Here's my profile https://www.upwork.com/freelancers/~0138d999529f34d33f, could you help send the offer? Thx

@miljakljajic
Copy link
Contributor

@daledah
Copy link
Contributor

daledah commented Sep 4, 2024

@miljakljajic I accepted it

@miljakljajic
Copy link
Contributor

Paid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review
Projects
None yet
Development

No branches or pull requests

6 participants