-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-05-25] [$1000] Pressing enter twice on selecting currency from search closes the send money/request money option #18265
Comments
Triggered auto assignment to @alexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing enter twice on selecting currency from search closes the send money/request money option What is the root cause of that problem?The problem begins in how we handle the keyboard enter event App/src/components/OptionsSelector/BaseOptionsSelector.js Lines 59 to 67 in 846a50c
The problem with this is that the Enter key will call selectRow for as many times as it's pressed quickly which will eventually lead to Navigation.goBack to be called twice which will exit the entire modal Screen.Recording.2023-05-02.at.11.15.18.PM.movWhat changes do you think we should make in order to solve the problem?We can set up a condition to wait for the excution of the selectRow function before calling it again thust resolving the issue while keeping the component flexible for handing multipleOptions and selection changing. if(!isEnterDisabled){
isEnterDisabled = true;
let result = Promise.resolve(this.selectRow(focusedOption));
InteractionManager.runAfterInteractions(() => {
result.finally(() => isEnterDisabled = false);
});
} ResultScreen.Recording.2023-05-02.at.11.10.33.PM.mov |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
I'm catching up from being OOO on Friday and Monday, I'll try to test this one soon. |
I've run out of time this week; I will test over the weekend to continue the process. |
No update |
Job added to Upwork: https://www.upwork.com/jobs/~01d1daa29666491c62 |
Current assignee @alexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @abdulrahuman5196 ( |
Triggered auto assignment to @alex-mechler ( |
I tested and was able to verify. You can select any currency and click enter twice on your keyboard which will get the Send Money box to disappear. |
@AmjedNazzal As per guidelines we don't recommended to
Instead you could point to where you want to change(similar to the one you done in the root cause section) and what change you want to make. Could you kindly remove the actual code diff in the proposal and update the proposal accordingly and respond here once it is ready to be reviewed? Reference: |
@AmjedNazzal And on the existing proposal
This would regress other flows like Multiple Row selection cases, as once we select a row it will block enter being pressed again until component mounts again |
Thank you @abdulrahuman5196 I've edited the proposal accordingly |
@AmjedNazzal Thank you for updating the proposal. Your RCA is correct. But it seems, I wouldn't agree on this solution fully. Since it might cause a issue, in case we might want the user being able to switch his selection before confirming on the selection. Currently for currency selection its not the case, but we shouldn't limit BaseOptionsSelector.js component functionality to be capable of selecting only once during its mounted time. The 'BaseOptionsSelector.js' is a common component which is being used in multiple places, so I would suggest to have our solution without regressing its functionality. |
ProposalPlease re-state the problem that we are trying to solve in this issue.Pressing enter twice on selecting currency from search closes the send money/request money option What is the root cause of that problem?When we first time press enter App/src/pages/iou/IOUCurrencySelection.js Lines 128 to 131 in d2d9ce3
And it is calling Navigation.goBack() which closes current screen but it is doing it with animation and delaying componentWillUnmount which is responsible for unsubscribing from keyboard.Thus resulting in multiple same actions What changes do you think we should make in order to solve the problem?We can listen to whether transition is happening in our modal stack componentDidMount() {
this.unsubscribeStart = this.props.navigation.addListener('transitionStart', (e) => {
this.isNavigating = true;
});
this.unsubscribeEnd = this.props.navigation.addListener('transitionEnd', (e) => {
this.isNavigating = false;
});
} and can prevent any What alternative solutions did you explore? (Optional)We can also rather than just going back here App/src/pages/iou/IOUCurrencySelection.js Line 130 in d2d9ce3
Manually show where to go to previous stack Navigation.drawerGoBack(navigation.getState().routes[lastElement].name); |
ProposalUpdated with alternative solutions - #18265 (comment) |
@abdulrahuman5196 that's an excellent point, I didn't think of that. I've updated my proposal to account for that moving the checking logic to the currency selection component itself leaving BaseOptionSelector untouched to preserve it's flexibility for use in multiple components. |
@alitoshmatov Thank you for proposing solution. The reason is, this issue is not limited to Currency selection page, any page using BaseOptionsSelector.js component(or any new page we implement) with a similar requirement would be affected. So we should be thinking of fixing at the source of the issue which in this case might be BaseOptionsSelector.js without limiting its functionality. |
BugZero checklist:
This logic handling of multiple presses was never implemented and the requirement was also not identified in this case, so I don't we can point to a specific PR as bug creation PR.
Yes
Regression Test:
|
Triggered auto assignment to @kadiealexander ( |
I'm heading OOO tomorrow for about a week so adding another BZ member while I'm away to help keep the train moving! 🚂 Thanks @kadiealexander!! |
Regression test GH: https://github.com/Expensify/Expensify/issues/285621 |
@kadiealexander and @dylanexpensify - I appreciate your help here! I'm back online and removing your assignment. |
@alexpensify Gentle ping on the payment. |
It's payment time! @abdulrahuman5196 and @dhanashree-sawant please apply to the job here: https://www.upwork.com/jobs/~01d1daa29666491c62. After, I can continue with the payment process. Thank you! @AmjedNazzal - I see you applied, so I'm working on the payment process in Upwork now. |
@alexpensify Applied for the job in upwork. |
Alright, offers have been sent to @AmjedNazzal and @abdulrahuman5196-- please accept in Upwork. Thank you! @dhanashree-sawant when you apply, please let me know. Thank you! |
@alexpensify ⏩ 🐎 Accepted the offer |
@alexpensify Accepted the offer :) |
Hi @alexpensify, thanks I have applied to the job. |
@AmjedNazzal and @abdulrahuman5196 have been paid via upwork. Now waiting for @dhanashree-sawant to accept to complete that payment, then I'll close this GH. |
Thanks @alexpensify, I have accepted the offer. |
Perfect, everyone has been paid via Upwork and I closed the job. Great work! |
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 display enter amount page with selected currency as it does on single enter click
Actual Result:
App exits the send money/ request money option when we press enter twice to select the currency
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.8.8
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
twice.enter.exits.send.money.mp4
Recording.449.mp4
Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682793162634169
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: