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
List does not scroll up to show selected country when returning from Add bank account page #87454
Version Number: 9.3.55-0 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#85447 Email or phone of affected tester (no customers):applausetester+sjois2jd@applause.expensifail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: User Settings
Action Performed:
Precondition:
Have at least one workspace.
Go to staging.new.expensify.com
Go to Account > Wallet.
Click Add bank account.
Click Get reimbursed.
Scroll down and select any country.
Click RHP back button.
→ List scrolls to the top with the selected country visible.
Close the RHP.
Click Add bank account.
Click Make payments.
Scroll down and select any country.
Click RHP back button.
→ List does not scroll to the top, The selected country is not visible unless manually scrolled up.
Expected Result:
In Step 10, the selected country will be highlighted.
In Step 11, the list will scroll to the top with the selected country visible.
Actual Result:
In Step 10, the selected country is not highlighted.
In Step 11, the list does not scroll to the top, The selected country is not visible unless manually scrolled up.
👋 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.
Investigation Summary. Classification: Frontend bug. Causing PR: #85447 - fix: stabilize reopen ordering in basic pickers by @marufsharifi (High confidence). Recommendation: REVERT. PR 85447 introduced broken behavior in the Make payments country selection flow via useInitialSelection hook with resetOnFocus:true. The International Deposit Account sub-page navigation does not trigger useFocusEffect on back navigation the same way as the BankAccountPurposePage flow, so initialSelectedValue retains an outdated snapshot, causing moveInitialSelectionToTopByValue to not bring the selected country to the top and the highlight/scroll not to trigger. Assigned: @marufsharifi@linhvovan29546@srikarparsi. Labels: DeployBlockerCash kept, DeployBlocker to be removed.
When the user selects a country, taps "Next" (which navigates to the bank account flow), and then presses back, BankAccountPurposePage toggles showCountrySelection back to false (index.tsx:18-19), unmounting the CountrySelection component. When the user re-enters the flow, CountrySelectionremounts with a fresh useState, losing the user's prior selection entirely. This means selectedCountry resets to initialCountry (derived from policy currency, which may be empty), so nothing is highlighted and the list isn't reordered to show the selection at top.
Additionally, PR #85447 introduced shouldScrollToFocusedIndex={false} on the SelectionList in CountrySelectionList.tsx:94, which prevents the list from auto-scrolling to the selected item even when useInitialSelection correctly captures the value on focus.
What changes do you think we should make in order to solve the problem?
Persist the selected country in BankAccountPurposePage so it survives the unmount/remount cycle of CountrySelection:
Lift selectedCountry state up from CountrySelection into BankAccountPurposePage (which stays mounted throughout). Pass it down as a prop along with the setter. This way, when showCountrySelection toggles off and back on, the previously selected country is preserved.
Alternatively, persist the selection to the reimbursement account draft via updateReimbursementAccountDraft on each country tap (not just on confirm), mirroring how the "Get reimbursed" flow persists via fetchCorpayFields. Then initialize selectedCountry from the draft.
Option 1 is simpler and more consistent with the existing component structure.
What alternative solutions did you explore? (Optional)
Re-enabling shouldScrollToFocusedIndex — this would only fix the scroll-to-top behavior but not the missing highlight, since the root issue is the state being lost on remount.
Storing the selection in Onyx (similar to the "Get reimbursed" flow) — viable but heavier than lifting state to the parent, and requires cleanup logic.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.
Activity
melvin-bot commentedon Apr 9, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #85447
melvin-bot commentedon Apr 9, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Apr 9, 2026
👋 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:
OSBotify commentedon Apr 9, 2026
Investigation Summary. Classification: Frontend bug. Causing PR: #85447 - fix: stabilize reopen ordering in basic pickers by @marufsharifi (High confidence). Recommendation: REVERT. PR 85447 introduced broken behavior in the Make payments country selection flow via useInitialSelection hook with resetOnFocus:true. The International Deposit Account sub-page navigation does not trigger useFocusEffect on back navigation the same way as the BankAccountPurposePage flow, so initialSelectedValue retains an outdated snapshot, causing moveInitialSelectionToTopByValue to not bring the selected country to the top and the highlight/scroll not to trigger. Assigned: @marufsharifi @linhvovan29546 @srikarparsi. Labels: DeployBlockerCash kept, DeployBlocker to be removed.
marufsharifi commentedon Apr 9, 2026
@srikarparsi, please assign me to take care of it. thanks.
MelvinBot commentedon Apr 9, 2026
Proposal
What is the root cause of that problem?
The "Make payments"
CountrySelectioncomponent (BankAccountPurposePage/substeps/CountrySelection.tsx:51) stores the selected country only in local React state:When the user selects a country, taps "Next" (which navigates to the bank account flow), and then presses back,
BankAccountPurposePagetogglesshowCountrySelectionback tofalse(index.tsx:18-19), unmounting theCountrySelectioncomponent. When the user re-enters the flow,CountrySelectionremounts with a freshuseState, losing the user's prior selection entirely. This meansselectedCountryresets toinitialCountry(derived from policy currency, which may be empty), so nothing is highlighted and the list isn't reordered to show the selection at top.In contrast, the "Get reimbursed" flow (
InternationalDepositAccount/subPages/CountrySelection.tsx:15) initializes fromformValues.bankCountry, which is persisted to Onyx byfetchCorpayFields. So on remount, the selection survives.Additionally, PR #85447 introduced
shouldScrollToFocusedIndex={false}on theSelectionListinCountrySelectionList.tsx:94, which prevents the list from auto-scrolling to the selected item even whenuseInitialSelectioncorrectly captures the value on focus.What changes do you think we should make in order to solve the problem?
Persist the selected country in
BankAccountPurposePageso it survives the unmount/remount cycle ofCountrySelection:Lift
selectedCountrystate up fromCountrySelectionintoBankAccountPurposePage(which stays mounted throughout). Pass it down as a prop along with the setter. This way, whenshowCountrySelectiontoggles off and back on, the previously selected country is preserved.Alternatively, persist the selection to the reimbursement account draft via
updateReimbursementAccountDrafton each country tap (not just on confirm), mirroring how the "Get reimbursed" flow persists viafetchCorpayFields. Then initializeselectedCountryfrom the draft.Option 1 is simpler and more consistent with the existing component structure.
What alternative solutions did you explore? (Optional)
shouldScrollToFocusedIndex— this would only fix the scroll-to-top behavior but not the missing highlight, since the root issue is the state being lost on remount.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.IuliiaHerets commentedon Apr 10, 2026
iPhone 13 / iOS 26.4
v9.3.57-1
not repro
wallet.MP4