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
[Due for payment 2025-08-13][$250] 2FA- 2FA verifying page is not fully displayed because keyboard open #65485
Version Number: v9.1.76-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:#65155 Email or phone of affected tester (no customers):gocemate+b2153624@gmail.com Issue reported by: Applause Internal Team Device used: Samsung Galaxy A02s/12 App Component: Other
Action Performed:
Open the app
Navigate to Security > Two-factor authentication
Click Copy
Click Next
Expected Result:
2FA verifying page should be fully displayed
Actual Result:
2FA verifying page is not fully displayed because keyboard open
Please re-state the problem that we are trying to solve in this issue.
2FA- 2FA verifying page is not fully displayed because keyboard open
What is the root cause of that problem?
The ScreenWrapper in TwoFactorAuthWrapper is using the default keyboard avoiding behavior which causes the content to shift up when the keyboard appears
so for small screens when the page opens the keyboard is open and because the content above the footer has it's own scroll view it will display only the begining part of the content and the last part of the content is accessed only if scrolled. This creates a weird experience and not consistent with other form pages in the App
Moreover, the input is auto focused on mobile devices so the keyboard immediately opens on opening the page and the keyboard will take the space and make reading the above content difficult.
What changes do you think we should make in order to solve the problem?
The ScrollView should contain the FixedFooter too so that the whole content in the page is scrollable together and then we will need to apply flex1 to parent view here to put the footer always on bottom when the content is smaller than the screen height available
if (!inputRef.current || isSmallScreenWidth) {
return;
}
We can alternatively use other checks like canUseTouchScreen or canFocusInputOnScreenFocus to precisely identify their is an on-screen keyboard. Because we use TwoFactorAuthForm in different page if needed we can control the auto-focusing behavior with a new prop to apply it selectively.
In addition to that, we have a bug in MagicCodeInput where the first box is highlighted without the text input getting focused because we always set the focusedIndex to 0 here so we should only set it to 0 if the autoFocus is true otherwise we should set it to undefined
I don't think I understand this "bug" - how would you type in the code without the keyboard open?
The page shows:
QR code for scanning with authenticator app
Secret key for adding to authenticator app manually
Space to enter in the 6-digit code to confirm the authenticator app - for which the keyboard opens.
If that's not the expected behaviour, what is? The OP here just says "FA verifying page should be fully displayed" - that's pretty loose and unhelpful IMO.
I would expect the expected behaviour to be:
The keyboard is hidden until the 6-digit code field is interacted with
When the first code field is tapped into, the keyboard is shown
In addition, the tester said that only "Android: mWeb Chrome" is affected. I have just tested it and see that is an issue on:
iOS app
iOS mWeb Safari - this one is hideous
Android app
Android mWeb Chrome
The only mobile environment it works well is iOS mWeb Chrome, which works exactly as my "expected behaviour" outlined above.
@DylanDylann this to me doesn't seem related to #64404 which appears to be specific to safari on mac.
Please re-state the problem that we are trying to solve in this issue.
2FA verifying page is not fully displayed because keyboard open
What is the root cause of that problem?
We want to change the behavior, the magic code input shouldn't be focused automatically
Previously, we defaulted to using autoFocus on MagicCodeInput and then in #65155 we only change how to focus automatically from using autoFocus to using useFocusEffect to focus manually
What changes do you think we should make in order to solve the problem?
Because we don't want MagicCodeInput is focused automatically anymore
We can discuss to consider doing the same behavior in other MagicCodeInput
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can simulate the MagicCodeInput and verify that the input isn't focused automatically, and then simulate a press action on the input and verify that it focuses on the input
What alternative solutions did you explore? (Optional)
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!
changed the title [-][$250] 2FA- 2FA verifying page is not fully displayed because keyboard open[/-][+][Due for payment 2025-08-13][$250] 2FA- 2FA verifying page is not fully displayed because keyboard open[/+]on Aug 13, 2025
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] 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: I wasn't able to pinpoint the exact PR that caused this.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jul 4, 2025
Triggered auto assignment to @RachCHopkins (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.ryntgh commentedon Jul 4, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
2FA- 2FA verifying page is not fully displayed because keyboard open
What is the root cause of that problem?
The
ScreenWrapperinTwoFactorAuthWrapperis using the default keyboard avoiding behavior which causes the content to shift up when the keyboard appearsApp/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthWrapper.tsx
Lines 76 to 81 in d719349
What changes do you think we should make in order to solve the problem?
We should pass
shouldEnableKeyboardAvoidingView={false}to theTwoFactorAuthWrapperlike we did in other page likeCopyCodesPageApp/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Line 74 in d719349
Additionally, we can move the
TwoFactorAuthFormto the bottom of theenterCodetext, so it does not stick to the footer withFixedFooterApp/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Lines 121 to 123 in d719349
App/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Line 117 in d719349
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
FitseTLT commentedon Jul 4, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
2FA- 2FA verifying page is not fully displayed because keyboard open
What is the root cause of that problem?
We display the next button and input out of the scroll view which contains the other content in the page
App/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Lines 119 to 136 in 74e1436
so for small screens when the page opens the keyboard is open and because the content above the footer has it's own scroll view it will display only the begining part of the content and the last part of the content is accessed only if scrolled. This creates a weird experience and not consistent with other form pages in the App
Moreover, the input is auto focused on mobile devices so the keyboard immediately opens on opening the page and the keyboard will take the space and make reading the above content difficult.
What changes do you think we should make in order to solve the problem?
App/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Line 88 in 74e1436
App/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthForm/BaseTwoFactorAuthForm.tsx
Lines 93 to 96 in 30d781e
We can alternatively use other checks like
canUseTouchScreenorcanFocusInputOnScreenFocusto precisely identify their is an on-screen keyboard. Because we useTwoFactorAuthFormin different page if needed we can control the auto-focusing behavior with a new prop to apply it selectively.In addition to that, we have a bug in MagicCodeInput where the first box is highlighted without the text input getting focused because we always set the focusedIndex to
0here so we should only set it to0if the autoFocus is true otherwise we should set it toundefinedApp/src/components/MagicCodeInput.tsx
Line 115 in c73ede0
Then we should set
focusedIndexto the lastFocusedIndex hereApp/src/components/MagicCodeInput.tsx
Lines 157 to 158 in c73ede0
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N / A
What alternative solutions did you explore? (Optional)
mountiny commentedon Jul 7, 2025
@thelullabyy @deetergp @DylanDylann Can you please follow up here as it seems to be related to this PR #65155
DylanDylann commentedon Jul 7, 2025
I still can reproduce this bug even after reverting #65155
Screen_Recording_20250707_164922_Chrome.mp4
melvin-bot commentedon Jul 7, 2025
@RachCHopkins Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
RachCHopkins commentedon Jul 7, 2025
I don't think I understand this "bug" - how would you type in the code without the keyboard open?
The page shows:
If that's not the expected behaviour, what is? The OP here just says "FA verifying page should be fully displayed" - that's pretty loose and unhelpful IMO.
I would expect the expected behaviour to be:
In addition, the tester said that only "Android: mWeb Chrome" is affected. I have just tested it and see that is an issue on:
The only mobile environment it works well is iOS mWeb Chrome, which works exactly as my "expected behaviour" outlined above.
@DylanDylann this to me doesn't seem related to #64404 which appears to be specific to safari on mac.
DylanDylann commentedon Jul 8, 2025
@RachCHopkins It seems a good idea.
truph01 commentedon Jul 8, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
2FA verifying page is not fully displayed because keyboard open
What is the root cause of that problem?
We want to change the behavior, the magic code input shouldn't be focused automatically
Previously, we defaulted to using autoFocus on MagicCodeInput and then in #65155 we only change how to focus automatically from using autoFocus to using useFocusEffect to focus manually
What changes do you think we should make in order to solve the problem?
Because we don't want MagicCodeInput is focused automatically anymore
We need to remove this useFocusEffect
App/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthForm/BaseTwoFactorAuthForm.tsx
Line 93 in 30d781e
and this method
App/src/pages/settings/Security/TwoFactorAuth/TwoFactorAuthForm/BaseTwoFactorAuthForm.tsx
Line 83 in 30d781e
We can discuss to consider doing the same behavior in other MagicCodeInput
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
We can simulate the MagicCodeInput and verify that the input isn't focused automatically, and then simulate a press action on the input and verify that it focuses on the input
What alternative solutions did you explore? (Optional)
21 remaining items
melvin-bot commentedon Aug 7, 2025
This issue has not been updated in over 15 days. @dangrous, @allroundexperts, @RachCHopkins, @FitseTLT 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!
FitseTLT commentedon Aug 7, 2025
The PR went to production yesterday @RachCHopkins automation failed, so can you apply the appropriate labels? Thx
[-][$250] 2FA- 2FA verifying page is not fully displayed because keyboard open[/-][+][Due for payment 2025-08-13][$250] 2FA- 2FA verifying page is not fully displayed because keyboard open[/+]RachCHopkins commentedon Aug 13, 2025
@allroundexperts can we get a checklist please?
allroundexperts commentedon Aug 14, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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: I wasn't able to pinpoint the exact PR that caused this.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/536574
Regression Test Proposal
Precondition:
Test:
Verify that magic input is only auto-focused on Web/Desktop and not mobile.
Do we agree 👍 or 👎
RachCHopkins commentedon Aug 15, 2025
Payment Summary:
Upwork job here
RachCHopkins commentedon Aug 15, 2025
Contributor has been paid, the contract has been completed, and the Upwork post has been closed.
🟢 for @allroundexperts to request payment via NewDot.
trjExpensify commentedon Jan 5, 2026
approved $250 for @allroundexperts.