Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: v9.1.98-7
Reproducible in staging?: Y
Reproducible in production?: Y
Issue reported by: @joekaufmanexpensify
Slack conversation: #design
Action Performed:
Note: below is just an example of one place this issue occurs. There are others, like the country list when adding a personal bank account on the Wallet. We'd like to fix this here for all relevant lists in the app at once.
- Login to device on mobile (iOS or Android).
- Go to Workspaces.
- Go to Company cards.
- Tap Add cards, which opens the country list.
Expected Result:
We should show the pre-selected country at the top of the list, similar to how we show the pre-selected category at the top in the category list selector. This ensures the pre-selected item in the list is always visible when it opens, even on mobile and when the search input is focused/keyboard opened.
Actual Result:
We show the pre-selected country where it appears in the list, and scroll the list so that item appears in the middle. Because the search field is focused when we open the list, this means the pre-selected item is often hidden behind the keyboard on mobile. This leads the user to often unnecessarily search for what is already selected, adding friction to the flow.
Workaround:
N/A
Platforms:
Select the officially supported platforms where the issue was reproduced:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Pre-selected item on country list with keyboard open (it's hidden)
Pre-selected item on country list with keyboard closed (it's shown)
Pre-selected item on category selector at top of list
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021960884844686682023
- Upwork Job ID: 1960884844686682023
- Last Price Increase: 2025-08-28
- Automatic offers:
- linhvovan29546 | Reviewer | 110178207
Issue Owner
Current Issue Owner: @marufsharifi
Activity
melvin-bot commentedon Aug 25, 2025
Triggered auto assignment to @strepanier03 (
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.daledah commentedon Aug 25, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
We show the pre-selected country where it appears in the list, and scroll the list so that item appears in the middle. Because the search field is focused when we open the list, this means the pre-selected item is often hidden behind the keyboard on mobile. This leads the user to often unnecessarily search for what is already selected, adding friction to the flow.
What is the root cause of that problem?
Improvement
What changes do you think we should make in order to solve the problem?
We have two approaches:
SelectionListcomponentWe should sort data before passing to
SelectionListcomponent. For country selector, we can update hereApp/src/libs/searchOptions.ts
Line 16 in d0d75ed
App/src/libs/searchOptions.ts
Lines 17 to 19 in d0d75ed
Make similar changes here:
App/src/libs/searchOptions.ts
Lines 48 to 58 in d0d75ed
App/src/libs/searchOptions.ts
Lines 62 to 70 in d0d75ed
And make the same changes for all selection lists usage throughout the App if needed.
This approach is more time-consuming, but is risk-free.
SelectionListAdd a flag
shouldSortSelectedand a callbackgetSortedDataUse in these places
App/src/components/SelectionList/BaseSelectionList.tsx
Line 237 in d0d75ed
And here
App/src/components/SelectionList/BaseSelectionList.tsx
Lines 302 to 308 in d0d75ed
More changes and behaviours can be figured out in the PR phase.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
SAYAN02-DEV commentedon Aug 25, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
We should show the pre-selected item at the top of selection lists, similar to how we show the pre-selected category at the top in the category list selector. This ensures the pre-selected item is always visible when the list opens, even on mobile and when the search input is focused/keyboard is open.
What is the root cause of that problem?
Currently, we show the pre-selected item where it appears in the list and scroll the list so the item appears in the middle. Because the search field is focused when we open the list, this means the pre-selected item is often hidden behind the keyboard on mobile. This leads users to unnecessarily search for what is already selected, adding friction to the flow.
What changes do you think we should make in order to solve the problem?
I've implemented a consistent pattern across all selection components to show the selected item at the top when not searching. Here's the implementation approach:
I've implemented a consistent pattern across all selection components to show the selected item at the top when not searching. Here are the files that can be updated to implement the change:
Before Fix
After Fix
More UX adjustments can be talked about during the PR phase.
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?
N/A
lorretheboy commentedon Aug 26, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-08-29 10:31:46 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Move pre-selected list items to top of list throughout the app
What is the root cause of that problem?
We have several places that doesn't handle this case such as
App/src/components/UnitPicker.tsx
Line 24 in f9775a2
App/src/components/ValuePicker/ValueSelectionList.tsx
Line 6 in 5a8f82a
App/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx
Line 20 in 3c2a24d
What changes do you think we should make in order to solve the problem?
We introduce new util
moveSelectedOptionsToTopin searchOptions.tsThen we should return the moved selected options to Top instead of
optionshereApp/src/libs/searchOptions.ts
Line 18 in d66962c
For the case
UnitPicker, we can add this codeFor the case
ValueSelectionList, we add thisFor the case
CustomCloseDateSelectionListAlso we need to remove initiallyFocusedOptionKey to set it to undefined
App/src/pages/workspace/companyCards/WorkspaceCompanyCardStatementCloseDateSelectionList/CustomCloseDateSelectionList.tsx
Lines 48 to 51 in 3c2a24d
By using this way, we can make sure that all existing and future uses of these components will follow the convention that the selected item is on top
To fix the highlighted selection issue. I propose a solution that for the user manual selection, we should not auto order to top, instead keep it remains position
To address this, we can add one more props to
searchOptionsfunction calledshouldMoveSelectedToTop, then we can turn on/off like thisIn the parent component which is
CountrySelectionPage, we should add a state to track itNote: We need to do like this for all places
Or if we don't want to use useState to track status, we can update like this
We use useMemo to control reordering: only reorder when showing full list (no search) and only on the very first render when searchValue is empty
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
melvin-bot commentedon Aug 28, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021960884844686682023
[-]Move pre-selected list items to top of list throughout the app[/-][+][$250] Move pre-selected list items to top of list throughout the app[/+]melvin-bot commentedon Aug 28, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @linhvovan29546 (
External)331 remaining items
melvin-bot commentedon Oct 21, 2026
@linhvovan29546 / @marufsharifi
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.15-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
jponikarchuk commentedon Nov 10, 2026
Deploy Blocker #106467 was identified to be related to the PR #104693 that attempted to fix this issue.
melvin-bot commentedon Nov 11, 2026
@linhvovan29546 / @marufsharifi
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.35-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]
thelullabyy commentedon Nov 13, 2026
Hi if needed, I can help to continue Maruf works here
mallenexpensify commentedon Nov 13, 2026
Claude posting on behalf of Matt:
@thelullabyy please take over as the Contributor. Use PR #104714 as a reference and open your own PR: #104714
@linhvovan29546 stays the C+.
Please use MelvinBot where it can help.