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] Request - App displays extra line below description when we use enter to save the description #28181

Closed
2 of 6 tasks
kbecciv opened this issue Sep 25, 2023 · 30 comments
Closed
2 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Sep 25, 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. Open the app
  2. Open request money report or raise new request and open the report
  3. Open description
  4. Make some changes and press enter to save
  5. Observe that app displays cursor in new line before saving the description

Expected Result:

App should not add new line on enter in description as enter is used to save the description

Actual Result:

App adds new line in description and also triggers save when we open description and use enter to save the description

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

Enter.to.save.description.add.new.line.mac.chrome.desktop.mov

image (52)

Recording.4763.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695464573868509

View all open jobs on GitHub

@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 25, 2023
@melvin-bot melvin-bot bot changed the title Request - App displays extra line below description when we use enter to save the description [$500] Request - App displays extra line below description when we use enter to save the description Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016a43fd5e9a09f472

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

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

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@micahelchan623
Copy link

micahelchan623 commented Sep 25, 2023

Proposal

Please re-state the issue
App adds new line in description and also triggers save when we open description and use enter to save the description

What is the root cause of the problem?
The root cause of having an extra line added when pressing Enter in a TextInput component is the default behavior of multiline text inputs line. By default, when the Enter key is pressed, a newline character (\n) is inserted into the text input value, resulting in a new line being created.

What changes do you think should be made to fix this problem?
Options1. remove \n when on submit

 <EditRequestDescriptionPage
          defaultDescription={transactionDescription}
          onSubmit={(transactionChanges) => {
              // In case the comment hasn't been changed, do not make the API request.
              if (transactionChanges.comment.trim() === transactionDescription) {
                  Navigation.dismissModal();
                  return;
              }
              editMoneyRequest({comment: transactionChanges.comment.trim.()replace(/\n$/, '')}); // add code here
          }}
      />

P.S: depends on the scope, you can also remove the \n on Form to align the behavior across the app

What other alternative options did you explore? (Optional)

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@micahelchan623
Copy link

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@saranshbalyan-1234
Copy link
Contributor

Proposal

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

Upon pressing enter on the description, it enters a new line while submitting the form.

What is the root cause of that problem?

The root cause is we are not preventing th default functionality of enter button. We have just added a new functionality that enter button should do this over here.

if (tagName === 'TEXTAREA' && lodashGet(event, 'target.dataset.submitOnEnter', 'false') === 'true') {
onSubmit();
return;
}

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

The only change we have to do it to prevent the default functionality of the enter button which can be done easily by

    if (tagName === 'TEXTAREA' && lodashGet(event, 'target.dataset.submitOnEnter', 'false') === 'true') {
            event.preventDefault();
            onSubmit();
            return;
        }

What alternative solutions did you explore? (Optional)

N/A

@alexpensify alexpensify removed their assignment Sep 26, 2023
@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@abdulrahuman5196
Copy link
Contributor

Will review in couple of hours

@melvin-bot melvin-bot bot removed the Overdue label Sep 28, 2023
@abdulrahuman5196
Copy link
Contributor

@saranshbalyan-1234 's proposal here #28181 (comment) looks good and works well.

🎀 👀 🎀
C+ Reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 29, 2023

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

@melvin-bot melvin-bot bot added the Overdue label Oct 2, 2023
@abdulrahuman5196
Copy link
Contributor

Not overdue melvin. People would be just back from weekend. Anyways Pending review on @luacmartins

@melvin-bot melvin-bot bot removed 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 3, 2023
@saranshbalyan-1234
Copy link
Contributor

@abdulrahuman5196 PR is ready to be reviewed. Please check

@saranshbalyan-1234
Copy link
Contributor

Friendly bump to process payment for this issue

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

Not a regression. Seems we found this issue now only.

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.

Minor bug and wouldn't be beneficial to add regression tests.

@abdulrahuman5196
Copy link
Contributor

@adelekennedy Seems melvin didn't update this issue properly.
Seems the PR went to production 2 weeks back #28739 (comment)

Can we process the payments for this issue?

@adelekennedy
Copy link

adelekennedy commented Oct 18, 2023

Thank you for the bump!

Payouts due:

Issue Reporter: $50 @dhanashree-sawant
Contributor: $750 @saranshbalyan-1234
Contributor+: $750 @abdulrahuman5196

Eligible for 50% Y

Upwork job is here.

@abdulrahuman5196
Copy link
Contributor

@adelekennedy Merge time is the one to consider for urgency bonus. This PR was merged in almost a day, so eligible for the bonus.

Applied in upwork.

@saranshbalyan-1234
Copy link
Contributor

Not able to apply on Upwork, please send an offer

@dhanashree-sawant
Copy link

Hi @adelekennedy, on upwork, it says that offer is not available. can you resend it once?

@saranshbalyan-1234
Copy link
Contributor

Hi @adelekennedy please have a look

@adelekennedy
Copy link

reposted the job here

@saranshbalyan-1234
Copy link
Contributor

accepted

@saranshbalyan-1234
Copy link
Contributor

@adelekennedy friendly bump for payment

@abdulrahuman5196
Copy link
Contributor

Accepted invite @adelekennedy

@abdulrahuman5196
Copy link
Contributor

Gentle ping @adelekennedy

@adelekennedy
Copy link

adelekennedy commented Oct 30, 2023

@abdulrahuman5196 On my end Upwork shows this contract as being paid and completed (with the bonus included)
Screenshot 2023-10-30 at 8 55 38 AM

@abdulrahuman5196
Copy link
Contributor

@adelekennedy Sorry. I was looking at the old upwork contract. Got paid thank you.

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. External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants