You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-04-25] [$500] [LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text #36862
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff
Version Number: v1.4.43-0 Reproducible in staging?: Y Reproducible in production?: N Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause-Internal Team Slack conversation:
Action Performed:
Pre-requisite: the user should be logged in.
Initiate a manual money request.
Enter the amount.
Do a text selection.
Click on any part of the request page.
Verify the text is not deselected.
Expected Result:
The text should be deselected after clicking on the page.
Actual Result:
The text is not deselected, remains highlighted.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
We think that this bug might be related to #vip-bills
CC @davidcardoza
PS: We shouldn't use setSelection when we use onMouseDown for following reasons:
The default behaviour of the app/web is to blur the input when pressing outside and updating selection will focus instead of blurring the input.
If half of the input value is selected then tapping outside will set selection will set the cursor to last text/number
Unnecessary re-renders
Inconsistency with the time input, in time input page we do blur the input and remove selection when pressing outside.
Result
text_selection_amount_form.mp4
Alternative
Remove event.preventDefault(); in onMouseDown.
Optional
The text selection is also not removed when we move to currency selection page and go back. For that we can use isFocused state and reset the selection to:
If we want the same behaviour on native devices also we need to wrap View with PressableWithoutFeedback execute the same functionality like onMouseDown when onPress in triggered.
changed the title [-] Request money - When amount is highlighted, clicking on the page does not deselect the text[/-][+][LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/+]on Feb 20, 2024
changed the title [-][LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/-][+][$500] [LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/+]on Feb 21, 2024
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringInternalRequires API changes or must be handled by Expensify staff
Activity
melvin-bot commentedon Feb 20, 2024
Triggered auto assignment to @laurenreidexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.izarutskaya commentedon Feb 20, 2024
I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors.
We think that this bug might be related to #vip-bills
CC @davidcardoza
Krishna2323 commentedon Feb 20, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Request money - When amount is highlighted, clicking on the page does not deselect the text
What is the root cause of that problem?
We call
event.preventDefault();inonMouseDowncallback function, and due to this the text doesn't get deselected.App/src/pages/iou/steps/MoneyRequestAmountForm.js
Lines 107 to 112 in c261148
What changes do you think we should make in order to solve the problem?
Initial Proposal
We should use `removeAllRanges` after calling `event.preventDefault();` in `onMouseDown`.This can be done using code below:
PS: We shouldn't use
setSelectionwhen we useonMouseDownfor following reasons:Result
text_selection_amount_form.mp4
Alternative
Remove
event.preventDefault();inonMouseDown.Optional
The text selection is also not removed when we move to currency selection page and go back. For that we can use
isFocusedstate and reset the selection to:Bug Video:
bug_selection_2.mp4
Alternative 2
We can set selection start and end to
selection.endafter we prevent default.If we also want to fix the bug I mentioned in the optional section, we can do that like:
If we want the same behaviour on native devices also we need to wrap
ViewwithPressableWithoutFeedbackexecute the same functionality like onMouseDown whenonPressin triggered.Demo Code
Result
fix_amount_selection.mp4
davidcardoza commentedon Feb 20, 2024
Adding to the vip bill pay project board as a
LOWissue[-] Request money - When amount is highlighted, clicking on the page does not deselect the text[/-][+][LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/+][-][LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/-][+][$500] [LOW] Request money - When amount is highlighted, clicking on the page does not deselect the text[/+]melvin-bot commentedon Feb 21, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01626cde7ff61398d1
88 remaining items
melvin-bot commentedon Apr 25, 2024
Payment Summary
Upwork Job
BugZero Checklist (@laurenreidexpensify)
laurenreidexpensify commentedon Apr 26, 2024
Payment Summary:
Contributor: $500 @Krishna2323 paid in upwork
C+: $500 @situchan to be paid in Upwork
steps to complete when @situchan is back from OOO in May:
situchan commentedon May 17, 2024
@laurenreidexpensify Sorry for late. Can you please send new offer?
laurenreidexpensify commentedon May 20, 2024
@situchan offer sent in upwork 👍
laurenreidexpensify commentedon May 21, 2024
Payment Summary:
Contributor: $500 @Krishna2323 paid in upwork
C+: $500 @situchan paid in upwork
laurenreidexpensify commentedon May 21, 2024
@situchan can you confirm regression testing steps so we can close out thanks
situchan commentedon May 21, 2024
Regression Test Proposal