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: 9.1.21-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: No, reproducible on hybrid only
If this was caught during regression testing, add the test name, ID and link from TestRail: Exp
Email or phone of affected tester (no customers): applausetester+260302kh@applause.expensifail.com
Issue reported by: Applause Internal Team
Device used: iPhone 15 Pro Max / iOS 18.3
App Component: Other
Action Performed:
- Launch hybrid app.
- Open FAB > Start chat.
- Make sure it opens Chat page, or else go to Chat, close it and repeat Step 2.
- Tap #Room.
Expected Result:
Room name field will remain focused.
Actual Result:
Room name field is auto unfocused and the field throws error "Please enter a room name".
Workaround:
Unknown
Platforms:
- Android: Standalone
- Android: HybridApp
- Android: mWeb Chrome
- iOS: Standalone
- iOS: HybridApp
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Bug6787979_1743431804425.ScreenRecording_03-31-2025_22-32-51_1.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021906800718426819330
- Upwork Job ID: 1906800718426819330
- Last Price Increase: 2025-04-14
- Automatic offers:
- ikevin127 | Contributor | 106963135
Activity
melvin-bot commentedon Mar 31, 2025
Triggered auto assignment to @maddylewis (
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.[-]Hybrid - iOS - FAB - Room name field is auto unfocused when switching from Chat to #Room[/-][+][$250] Hybrid - iOS - FAB - Room name field is auto unfocused when switching from Chat to #Room[/+]melvin-bot commentedon Mar 31, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021906800718426819330
melvin-bot commentedon Mar 31, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary (
External)bernhardoj commentedon Mar 31, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
The auto focus of the new room page is lost when switching tabs.
What is the root cause of that problem?
This kind of issue was previously fixed in #28646 where they introduced a 600ms delay when auto-focusing.

However, this PR #29203 maybe unintentionally change the delay to 300ms that is coming from
useAutoFocusInputhook.App/src/hooks/useAutoFocusInput.js
Lines 28 to 30 in 5e01376
For context, we have this old issue that has the same issue. I have a proposal there and there is a deeper investigation about the issue.
What changes do you think we should make in order to solve the problem?
Have a new param to
useAutoFocusInputcalleddelaythat has a default value ofCONST.ANIMATED_TRANSITION. For the new room page, we will pass a custom 600ms delay.However, there is another logic to auto focus the input after the side pane transition ends, but it's triggered on the first mount too.
App/src/hooks/useAutoFocusInput.ts
Lines 57 to 65 in 003d14f
To fix it, we need to skip it if it's the initial mount (using a ref).
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
ntdiary commentedon Apr 2, 2025
Still under review, requires further investigation.
I'm curious about the root cause of the input losing focus.
melvin-bot commentedon Apr 7, 2025
@ntdiary Huh... This is 4 days overdue. Who can take care of this?
ntdiary commentedon Apr 7, 2025
I've figured out the root cause of the focus loss. The key sequence is
#Roomtab.setViewControllers:direction:animated:completion:)useAutoFocusInputhook assigns focus to the room name input field.removeFromSuperview, which causes the input to lose focus.We can fix this by focusing only after animations complete (two approaches):
onPageSelectedevent, but right now,react-navigationdoesn’t expose that event to the app.Personally, I think the second approach might be better. :)
64 remaining items
melvin-bot commentedon Jun 2, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 2, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.54-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
onPageSelectedasonTabSelectto fixStart chattab switching input fields losing focus #60468If no regressions arise, payment will be issued on 2025-06-09. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 2, 2025
@ikevin127 / @getusha @maddylewis @ikevin127 / @getusha 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]
ikevin127 commentedon Jun 6, 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: No specific offending PR, just logic implemented over time which wasn't working as expected on all platforms, therefore I labeled this as
Result of the original design (eg. a case wasn't considered).[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:
Regression Test Proposal
Do we agree 👍 or 👎.
ikevin127 commentedon Jun 9, 2025
@maddylewis Please discard this, I will be requesting payment through NewDot Manual Requests as well ✅
A payment summary would help though 🙌
maddylewis commentedon Jun 9, 2025
Payment Overview + Regression Test GH
JmillsExpensify commentedon Jun 9, 2025
$250 approved for @ikevin127
garrettmknight commentedon Jul 17, 2025
$250 approved for @getusha
melvin-bot commentedon Feb 20, 2026
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.