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

[HOLD for payment 2023-10-13] [$500] Web - The input is lost focus on pressing enter key after no result found #28072

Closed
1 of 6 tasks
kbecciv opened this issue Sep 23, 2023 · 27 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

Comments

@kbecciv
Copy link

kbecciv commented Sep 23, 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. Go to Settings > Workspaces
  2. Select any workspace and open member page
  3. Click on the invite button
  4. Enter the random input that will display no result found
  5. Press the enter key

Expected Result:

The text input shouldn't lose focus

Actual Result:

The text input loses focus

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.73.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
Notes/Photos/Videos: Any additional supporting documentation

Screencast.from.21-09-2023.16_54_44.webm
Recording.4719.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695290112584589

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a6ef58dc2b8b4afd
  • Upwork Job ID: 1705612299507138560
  • Last Price Increase: 2023-09-23
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26976505
    • dukenv0307 | Contributor | 26976506
    • dukenv0307 | Reporter | 26976507
@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 Sep 23, 2023
@melvin-bot melvin-bot bot changed the title Web - The input is lost focus on pressing enter key after no result found [$500] Web - The input is lost focus on pressing enter key after no result found Sep 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

Triggered auto assignment to @kadiealexander (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 Sep 23, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 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

@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

Triggered auto assignment to @sonialiap (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 23, 2023

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

@kbecciv
Copy link
Author

kbecciv commented Sep 23, 2023

Proposal by: @dukenv0307
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695290112584589

Proposal

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

The input is lost focus on pressing enter key after no result found

What is the root cause of that problem?

We have the behavior of not losing focus if no options found in some pages due to this logic in BaseOptionsSelector, so it's clear that it's intentional.
There're 2 problems:

  • In screens that use the new SelectionList, we don't have that same blurOnSubmit logic. See here. There must be because the SelectionList is functionally similar to the OptionsSelector
  • In EmojiPicker, we also have search functionality but doesn't have the blurOnSubmit logic

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

blurOnSubmit={Boolean(flattenedSections.allOptions.length)}

(this is similar logic to the BaseOptionsSelector)

blurOnSubmit={this.state.searchTerm.length > 0 && this.state.filteredEmojis.length > 0}

(the searchTerm needs to be set to the state in onChangeText)

What alternative solutions did you explore? (Optional)

Any other search input that has the issue can be fixed similarly.

@JawadSadiq01
Copy link

Proposal

Please re-state the problem that we are trying to solve in this issue.
The input is lost focus on pressing enter key after no result found

What is the root cause of that problem?
Inside the reusable component filename "BaseSelectionList", there is a TextInput. The TextInput is calling a function "selectFocusedOption".

The definition of the selectFocusedOption function has below code that is causing the lost of focus on pressing enter.

 const selectFocusedOption = () => {
        const focusedOption = flattenedSections.allOptions[focusedIndex];

         if (!focusedOption || focusedOption.isDisabled) {
             // return;
        }

        selectRow(focusedOption, focusedIndex);
    };

If I remove or comment the return inside of if block code, then the TextInput won't loose its focus. In the case of the selectFocusedOption() function, all of the code that follows the return statement will not be executed. this means that the code that keeps the input field focused (the event.target.focus() call) will never be executed.

To fix this, you can simply remove or comment the return statement (BaseSelectionList.js#197) from the selectFocusedOption() function.

What alternative solutions did you explore? (Optional)
NA

See img
image

@melvin-bot
Copy link

melvin-bot bot commented Sep 24, 2023

📣 @JawadSadiq01! 📣
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>

@JawadSadiq01
Copy link

Contributor details
Your Expensify account email: creatorjawad@gmail.com
Upwork Profile Link: https://www.upwork.com/freelancers/~01f227068c4c3098d5

@melvin-bot
Copy link

melvin-bot bot commented Sep 24, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Sep 26, 2023
@0xmiros
Copy link
Contributor

0xmiros commented Sep 26, 2023

@dukenv0307's proposal looks good to me.
🎀 👀 🎀 C+ reviewed

@melvin-bot melvin-bot bot removed the Overdue label Sep 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 26, 2023

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

@kadiealexander
Copy link
Contributor

@nkuoch bump!

@0xmiros
Copy link
Contributor

0xmiros commented Sep 28, 2023

@dukenv0307 you may need to comment here to be assigned

@dukenv0307
Copy link
Contributor

@0xmiroslav Thanks for reminder.

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

melvin-bot bot commented Oct 2, 2023

📣 @0xmiroslav 🎉 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

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

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

Offer link
Upwork job

@dukenv0307
Copy link
Contributor

@0xmiroslav The PR is ready to review.

@melvin-bot
Copy link

melvin-bot bot commented Oct 4, 2023

🎯 ⚡️ Woah @0xmiroslav / @dukenv0307, great job pushing this forwards! ⚡️

The pull request got merged within 3 working days of assignment, so this job is eligible for a 50% #urgency bonus 🎉

  • when @dukenv0307 got assigned: 2023-10-02 09:33:13 Z
  • when the PR got merged: 2023-10-04 06:00:45 UTC

On to the next one 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Oct 6, 2023
@melvin-bot melvin-bot bot changed the title [$500] Web - The input is lost focus on pressing enter key after no result found [HOLD for payment 2023-10-13] [$500] Web - The input is lost focus on pressing enter key after no result found Oct 6, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Oct 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.78-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-10-13. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

For reference, here are some details about the assignees on this issue:

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot
Copy link

melvin-bot bot commented Oct 6, 2023

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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Oct 12, 2023
@kadiealexander
Copy link
Contributor

kadiealexander commented Oct 16, 2023

Payouts due:

  • Issue Reporter: $50 @dukenv0307
  • Contributor: $500 + $250 bonus @dukenv0307
  • Contributor+: $500 + $250 bonus @0xmiroslav

Eligible for 50% #urgency bonus? Yes

Upwork job is here.

@kadiealexander
Copy link
Contributor

@0xmiroslav please don't forget about the checklist :)

@melvin-bot melvin-bot bot added the Overdue label Oct 18, 2023
@kadiealexander
Copy link
Contributor

@0xmiroslav bump!

@0xmiros
Copy link
Contributor

0xmiros commented Oct 19, 2023

  • The PR that introduced the bug has been identified. Link to the PR: refactor: SelectionList multiple selection #22622
  • 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: https://github.com/Expensify/App/pull/22622/files#r1364914634
  • A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
  • Determine if we should create a regression test for this bug.
  • If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.

This is not bug but minor inconsistency. Not worth adding regression test.

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

No branches or pull requests

7 participants