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
[$125] Request money - The 'Enter' key fails to select the email/workspace/phone when requesting money. #34239
Version Number: 1.4.24-0 Reproducible in staging?: Y Reproducible in production?: N 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 Expensify/Expensify Issue URL: Issue reported by: Applause - Internal Team Slack conversation:
Action Performed:
Sign in to staging Expensify
Navigate to FAB > Request Money > Add amount, then press 'Enter' to select the email. Observe that the 'Enter' key does not work as expected
Expected Result:
The 'Enter' key should successfully select the email during the request for money
Actual Result:
The 'Enter' key does not select the email as intended during the request for money
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
and updated true inside the focus listener, but focus listener is called only if the screen is re-focused, not when the page is mounted, so isFocused is always false.
changed the title [-]Request money - The 'Enter' key fails to select the email/workspace/phone when requesting money.[/-][+][$125] Request money - The 'Enter' key fails to select the email/workspace/phone when requesting money.[/+]on Jan 10, 2024
The enter doesn't work on the amount page is a regression from #33055
The root cause is similar to the previous issue. The isFocused ref here is initially false and when we set up the config, the isActive is always false.
Even if the ref is updated, the config memo is never re-calculated.
It's better to use useIsFocused hook just like before the PR and add the focused state to the deps. We don't need to worry that it will re-render the Button component because, in that PR, we already separate the shortcut logic into a separate empty component.
But after fixing this, you will notice that pressing enter will show an invalid amount error and that is because the shortcut callback here is never recreated when onPress instance is updated.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
Activity
github-actions commentedon Jan 10, 2024
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon Jan 10, 2024
Triggered auto assignment to @youssef-lr (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.bernhardoj commentedon Jan 10, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
Can't select a participant with the enter key.
What is the root cause of that problem?
This is a regression from #31354.
When we select a participant, we return early if the screen is not focused.
App/src/components/OptionsSelector/BaseOptionsSelector.js
Lines 335 to 341 in 55746c7
isFocusedvalue initially is false.App/src/components/OptionsSelector/BaseOptionsSelector.js
Line 87 in 55746c7
and updated true inside the
focuslistener, butfocuslistener is called only if the screen is re-focused, not when the page is mounted, soisFocusedis always false.App/src/components/OptionsSelector/BaseOptionsSelector.js
Lines 102 to 117 in 55746c7
What changes do you think we should make in order to solve the problem?
We can set the initial value of
isFocusedto true, but we still need to duplicate the code from thefocuslistener to thecomponentDidMountisFocusedis actually not needed because we already unsubscribe the shortcut when component blurs[-]Request money - The 'Enter' key fails to select the email/workspace/phone when requesting money.[/-][+][$125] Request money - The 'Enter' key fails to select the email/workspace/phone when requesting money.[/+]melvin-bot commentedon Jan 10, 2024
youssef-lr commentedon Jan 10, 2024
I think this can be demoted.
melvin-bot commentedon Jan 10, 2024
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.21 remaining items
situchan commentedon Jan 11, 2024
yes, this will become deploy blocker on next deploy 😄
bernhardoj commentedon Jan 11, 2024
The enter doesn't work on the amount page is a regression from #33055
The root cause is similar to the previous issue. The
isFocusedref here is initially false and when we set up the config, theisActiveis always false.App/src/components/Button/index.tsx
Lines 153 to 164 in 7517d74
Even if the ref is updated, the config memo is never re-calculated.
It's better to use
useIsFocusedhook just like before the PR and add the focused state to the deps. We don't need to worry that it will re-render the Button component because, in that PR, we already separate the shortcut logic into a separate empty component.But after fixing this, you will notice that pressing enter will show an invalid amount error and that is because the shortcut callback here is never recreated when
onPressinstance is updated.App/src/components/Button/index.tsx
Lines 142 to 151 in 7517d74
The
onPresswill callsubmitAndNavigateToNextPageApp/src/pages/iou/steps/MoneyRequestAmountForm.js
Lines 229 to 233 in 7517d74
which will check the
currentAmountstate, but it's always empty when executed inside the shortcut callback.So, we should add
onPressto the shortcut callback deps.hurali97 commentedon Jan 11, 2024
@bernhardoj Thanks for pin pointing the issue, I have raised a PR fixing this 👍
melvin-bot commentedon Jan 11, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
melvin-bot commentedon Jan 11, 2024
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
mvtglobally commentedon Jan 30, 2024
Issue not reproducible during KI retests. (First week)
melvin-bot commentedon Feb 5, 2024
This issue has not been updated in over 15 days. @johncschuster, @youssef-lr, @bernhardoj eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
mvtglobally commentedon Feb 13, 2024
Issue not reproducible during KI retests. (Second week)
youssef-lr commentedon Feb 16, 2024
This was fixed.