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-09-16] [HOLD on new PR] [$250] [BACK BUTTON] Back Button on Report Detail Page Resets Scroll Position on Reports List #66751
Version Number: 9.1.84-4 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 Expensify/Expensify Issue URL: Issue reported by:@dannymcclain Slack conversation (hyperlinked to channel name): #Expensify Bugs
Action Performed:
Open the Reports page
Scroll down the list and select a report that's not near the top
After viewing the report, click the back button in the top-left corner
Expected Result:
The user should be returned to the same scroll position on the Reports page where they were before opening the report.
Actual Result:
The Reports page scrolls all the way to the top, and the user loses their place in the list.
Workaround:
Unknown
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
Platforms Tested:
On which of our officially supported platforms was this issue tested:
Android: App
Android: mWeb Chrome
iOS: App
iOS: mWeb Safari
iOS: mWeb Chrome
Windows: Chrome
MacOS: Chrome / Safari
MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidenceCleanShot.2025-07-18.at.11.09.28.mp4Recording.1433.mp4
What changes do you think we should make in order to solve the problem?
Add logic to save and get the scroll offset:
const listRef = useRef<FlashList<SearchListItem>>(null);
const {saveScrollOffset, getScrollOffset} = useContext(ScrollOffsetContext);
const route = useRoute();
const scrollToSavePosition = useCallback(() => {
const offset = getScrollOffset(route);
if (!(offset && listRef.current)) {
return;
}
// We need to use requestAnimationFrame to make sure it will scroll properly on iOS.
requestAnimationFrame(() => {
if (!(offset && listRef.current)) {
return;
}
listRef.current.scrollToOffset({offset}); // Can use animated here if needed
});
}, [getScrollOffset, route]);
const scrollOffset = getScrollOffset(route);
Update onScroll and onLayout function to use the above functions:
Wow yes, this is annoying. I thought this was to do with he browser back button which is a whole other kettle of fish, but this seems like something we should solve for sure.
changed the title [-]Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]on Jul 25, 2025
changed the title [-][HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][Due for payment 2025-09-16] [HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]on Sep 9, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.2-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@akinwale@twisterdotcom The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
changed the title [-][Due for payment 2025-09-16] [HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][Due for payment 2025-09-16] [HOLD on new PR] [$250] [BACK BUTTON] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]on Sep 11, 2025
Hello assignees. We came to the conclusion in #57969 that the back buttons in the app behave inconsistently and in a way that we don't think is ideal, but that fixing the issue is a potentially high cost, low reward situation. We are going to start tracking these issues and attempt to find a way and somebody who can help solve this problem heuristically across the app.
I have HELD a lot of issues related to the "back button" but any that are currently Reviewing or Due for payment I have not held. If you believe your issue shouldn't be linked or HELD, comment with the explanation and I will review and unlike/remove the hold. Thank you!
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:
[@akinwale] 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: N/A
[@akinwale] 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
[@akinwale] 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 18, 2025
Triggered auto assignment to @twisterdotcom (
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.thelullabyy commentedon Jul 19, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The Reports page scrolls all the way to the top, and the user loses their place in the list.
What is the root cause of that problem?
What is the root cause of that problem?
The Search list component is unmounted when navigating away. Upon remounting, it does not restore the previous scroll position because there is no logic in place to preserve or restore the scroll offset.
See https://reactnavigation.org/docs/stack-navigator/#detachinactivescreens
What changes do you think we should make in order to solve the problem?
onScrollandonLayoutfunction to use the above functions:App/src/components/Search/SearchList.tsx
Line 439 in bf05168
App/src/components/Search/SearchList.tsx
Line 447 in bf05168
App/src/components/ScrollOffsetContextProvider.tsx
Line 84 in bf05168
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)
melvin-bot commentedon Jul 22, 2025
@twisterdotcom Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
melvin-bot commentedon Jul 24, 2025
@twisterdotcom Eep! 4 days overdue now. Issues have feelings too...
twisterdotcom commentedon Jul 25, 2025
Wow yes, this is annoying. I thought this was to do with he browser back button which is a whole other kettle of fish, but this seems like something we should solve for sure.
[-]Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]melvin-bot commentedon Jul 25, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021948728734052183015
56 remaining items
[-][HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][Due for payment 2025-09-16] [HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]melvin-bot commentedon Sep 9, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Sep 9, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.2-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-09-16. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Sep 9, 2025
@akinwale @twisterdotcom The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]
[-][Due for payment 2025-09-16] [HOLD on new PR] [$250] Back Button on Report Detail Page Resets Scroll Position on Reports List[/-][+][Due for payment 2025-09-16] [HOLD on new PR] [$250] [BACK BUTTON] Back Button on Report Detail Page Resets Scroll Position on Reports List[/+]twisterdotcom commentedon Sep 11, 2025
Hello assignees. We came to the conclusion in #57969 that the back buttons in the app behave inconsistently and in a way that we don't think is ideal, but that fixing the issue is a potentially high cost, low reward situation. We are going to start tracking these issues and attempt to find a way and somebody who can help solve this problem heuristically across the app.
I have HELD a lot of issues related to the "back button" but any that are currently
ReviewingorDue for paymentI have not held. If you believe your issue shouldn't be linked or HELD, comment with the explanation and I will review and unlike/remove the hold. Thank you!akinwale commentedon Sep 17, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[@akinwale] 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: N/A
[@akinwale] 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
[@akinwale] 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/548891
Regression Test Proposal
Test:
Do we agree 👍 or 👎?
huult commentedon Sep 18, 2025
@twisterdotcom Just a friendly reminder about the pending payment 😊
twisterdotcom commentedon Sep 18, 2025
Payment Summary:
garrettmknight commentedon Sep 18, 2025
$250 approved for @akinwale