Closed kavimuru closed 1 year ago
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are β
)Cursor jumps to next position when we use ',' in request money when language is English
We are updating the cursor position using the non-comma stripped amount and subsequently strip the comma from the amount. Therefore, the new cursor position is based on the incorrect (longer) value, leading it to jump to the next position.
We should use the stripped amount for updating the cursor position, e.g.:
...
const strippedAmount = stripCommaFromAmount(newAmountWithoutSpaces);
setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, strippedAmount.length));
return strippedAmount;
...
This also fixes it for the Spanish scenario.
Ignoring event default behavior if the key is pressed, however this would require adding an extra handler.
@kavimuru can you re-test on v1.3.48-0? I can't seem to enter a comma when requesting money or splitting a bill.
@jliexpensify I've reproduced it on staging (v1.3.48-0). There are constraints to this bug, for example the cursor must not be placed at the beginning of the amount.
@samh-nl can you share a video? I can't get a cursor to show at all on my end :(
I'm on v1.3.48-4
@jliexpensify Here is the video.
https://github.com/Expensify/App/assets/43996225/e44cb2a1-9f50-48fc-b4fd-9b54a816388f
Thanks, that video helps - I've edited the GH issue and can repro.
Job added to Upwork: https://www.upwork.com/jobs/~01b976c4c3347bca34
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @0xmiroslav (External
)
π£ @servesh-chaturvedi! π£ 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>
π£ @Surojd! π£ 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: surojsmiling@gmail.com Upwork Profile Link: https://www.upwork.com/freelancers/surojd
β Contributor details stored successfully. Thank you for contributing to Expensify!
Please re-state the problem that we are trying to solve in this issue. Cursor jumps to next position when we use ',' in request money when language is English (or if using '.' in Spanish)
The non-comma-stripped amount is used to update the cursor location before the comma is removed. Because of this, the new cursor location is determined by the wrong (longer) value, causing it to advance to the following point.
[App/src/pages/iou/steps/MoneyRequestAmountPage.js](https://github.com/Expensify/App/src/pages/iou/steps/MoneyRequestAmountPage.js#L315-L318
setAmount((prevAmount) => {
setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, newAmountWithoutSpaces.length));
return stripCommaFromAmount(newAmountWithoutSpaces);
});
We should use the stripped amount for updating the cursor position, e.g.:
const strippedAmount = stripCommaFromAmount(newAmountWithoutSpaces);
setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, strippedAmount.length));
return strippedAmount;
This also fixes it for the Spanish scenario.
N/A
https://github.com/Expensify/App/assets/10323306/02e7faeb-ff9c-47c4-be99-c5737dd5a09e
Proposal Please re-state the problem that we are trying to solve in this issue. Cursor jumps to next position when we use ',' in request money when language is English https://github.com/Expensify/App/blob/ac49271c4009af1555f2513a11a7313831ae1961/src/pages/ReportDetailsPage.js#L18C1-L23C47 What is the root cause of that problem? We are updating the cursor position using the non-comma stripped amount and subsequently strip the comma from the amount. Therefore, the new cursor position is based on the incorrect (longer) value, leading it to jump to the next position.
What changes do you think we should make in order to solve the problem? We should use the stripped amount for updating the cursor position, e.g.:
... const strippedAmount = stripCommaFromAmount(newAmountWithoutSpaces); setSelection((prevSelection) => getNewSelection(prevSelection, prevAmount.length, strippedAmount.length)); return strippedAmount; ... This also fixes it for the Spanish scenario.
What alternative solutions did you explore? (Optional) Ignoring event default behavior if the key is pressed, however this would require adding an extra handler.
Bump @0xmiroslav - there are a few proposals to review!
π£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πΈ
Going to reassign this one.
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (External
)
Hi @eVoloshchak - can you help us out here? I've just reassigned and you're the lucky C+, cheers!
@samh-nl's proposal was the first to correctly identify the root cause and propose a fix, looks good to me, I think we should proceed with it
πππ C+ reviewed!
Triggered auto assignment to @danieldoglas, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ @eVoloshchak Please request via NewDot manual requests for the Reviewer role ($1000)
π£ @samh-nl π 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 π
π£ @dhanashree-sawant π An offer has been automatically sent to your Upwork account for the Reporter role π Thanks for contributing to the Expensify app!
@samh-nl assigned!
@samh-nl, could you open the PR when you have time? Thanks
@eVoloshchak I can submit the PR tomorrow. For mobile users we currently set disableKeyboard
and show the custom number pad. What would you recommend for testing mobile, use the keys present on the number pad?
@danieldoglas @eVoloshchak @jliexpensify @samh-nl this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
@danieldoglas @eVoloshchak @jliexpensify @samh-nl this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!
What would you recommend for testing mobile, use the keys present on the number pad?
If in mobile we can't see those, it's ok to show just our custom number pad and that it works normally.
PR is ready for review: https://github.com/Expensify/App/pull/25624
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one π
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.58-5 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-09-06. :confetti_ball:
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.
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:
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:
Payment summary:
@eVoloshchak can you complete the checklist? Thanks!
Bumping @eVoloshchak to complete the checklist please!
Paid in Upoworks, job removed. @eVoloshchak friendly bump to complete the checklist before we issue you payment, thanks!
Regression Test Proposal
Do we agree π or π
Reviewed the details for @eVoloshchak. $1,000 approved for payment via NewDot based on BZ summary.
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 change cursor position when we try to insert ',' in amount for English language OR '.' in amount for Spanish language in request money / split bill
Actual Result:
App changes cursor position when we try to insert ',' in amount for English language OR '.' in amount for Spanish language in request money / split bill
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.47-3 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/43996225/ad83a9fc-21f8-462b-a7da-025dfe9093ba
https://github.com/Expensify/App/assets/43996225/c0adb229-0aff-4663-8dec-02684e0998d1
Expensify/Expensify Issue URL: Issue reported by: @dhanashree-sawant Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690268210124929
View all open jobs on GitHub
Upwork Automation - Do Not Edit