Closed kbecciv closed 8 months ago
Triggered auto assignment to @adelekennedy (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Job added to Upwork: https://www.upwork.com/jobs/~016a43fd5e9a09f472
Platforms
in OP are ✅)Triggered auto assignment to @alexpensify (External
), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 (External
)
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)
📣 @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:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: michaeltsang623@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/~01ee8267303b35d44b
✅ Contributor details stored successfully. Thank you for contributing to Expensify!
Upon pressing enter on the description, it enters a new line while submitting the form.
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. https://github.com/Expensify/App/blob/e18ec42511682c1379710b7622b55957aaca20a7/src/components/FormSubmit/index.js#L29-L33
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;
}
N/A
Will review in couple of hours
@saranshbalyan-1234 's proposal here https://github.com/Expensify/App/issues/28181#issuecomment-1734282062 looks good and works well.
🎀 👀 🎀 C+ Reviewed
Triggered auto assignment to @luacmartins, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Not overdue melvin. People would be just back from weekend. Anyways Pending review on @luacmartins
@abdulrahuman5196 PR is ready to be reviewed. Please check
Friendly bump to process payment for this issue
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.
@adelekennedy Seems melvin didn't update this issue properly. Seems the PR went to production 2 weeks back https://github.com/Expensify/App/pull/28739#issuecomment-1750146499
Can we process the payments for this issue?
Thank you for the bump!
Issue Reporter: $50 @dhanashree-sawant Contributor: $750 @saranshbalyan-1234 Contributor+: $750 @abdulrahuman5196
Eligible for 50% Y
Upwork job is here.
@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.
Not able to apply on Upwork, please send an offer
Hi @adelekennedy, on upwork, it says that offer is not available. can you resend it once?
Hi @adelekennedy please have a look
reposted the job here
accepted
@adelekennedy friendly bump for payment
Accepted invite @adelekennedy
Gentle ping @adelekennedy
@abdulrahuman5196 On my end Upwork shows this contract as being paid and completed (with the bonus included)
@adelekennedy Sorry. I was looking at the old upwork contract. Got paid thank you.
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:
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?
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
https://github.com/Expensify/App/assets/93399543/9bdff803-c9f8-4ae6-a847-74224b831c6a
https://github.com/Expensify/App/assets/93399543/79576b1e-29d3-4462-a10a-892afa813ef3
Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695464573868509
View all open jobs on GitHub