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-12-04] [$250] Conversation - Cursor not auto-focused in composer when returning to chat with draft #67029
Type a message in the composer (message input box) but do not send it (leave it as a draft).
Navigate away from that chat to a different chat or screen.
Navigate back to the original chat with the draft message.
Expected Result:
When returning to a chat with a draft message, the cursor should be positioned at the end of the draft message, ready for the user to continue typing immediately.
Actual Result:
When returning to a chat with a draft message, the cursor does not appear in the composer, so the user has to manually tap the input box to continue editing.
Please re-state the problem that we are trying to solve in this issue.
Conversation - Cursor not auto-focused in composer when returning to chat with draft
What is the root cause of that problem?
Currently, we do not have a logic that would allow focusing, provided that there is a draftMessage. Now, focusing is done using the canFocusInputOnScreenFocus() function, which is why focusing does not happen automatically:
I also suggest redefining the shouldFocusInputOnScreenFocus change, which will also check if there is a draftMessage.
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)
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.
Please re-state the problem that we are trying to solve in this issue.
When a user navigates back to a chat that has a draft message, the cursor is not automatically focused in the composer input field. This forces users to manually tap the input box to continue editing their draft, creating poor UX compared to the expected behavior where they should be able to immediately continue typing.
What is the root cause of that problem?
When users navigate back to a chat, the system doesn't check for draft messages to determine if the composer should be auto-focused:
The listener fires when navigating to the chat but doesn't recognize that draft content indicates the user wants to continue typing.
What changes do you think we should make in order to solve the problem?
Add draft-aware focus logic to the existing navigation focus listener in ComposerWithSuggestions.tsx. When the navigation focus event fires, check if there's a draft message and automatically focus the composer with proper cursor positioning.
constunsubscribeNavigationFocus=navigation.addListener('focus',()=>{addKeyDownPressListener(focusComposerOnKeyPress);// The report isn't unmounted and can be focused again after going back from another report so we should update the composerRef againReportActionComposeFocusManager.composerRef.current=textInputRef.current;setUpComposeFocusManager();// Auto-focus composer if there's a draft message when navigating back to this chatif(draftComment&&shouldShowComposeInput&&areAllModalsHidden()){focus();updateMultilineInputRange(textInputRef.current,true);}});
This ensures the composer gains focus, the cursor is positioned at the end of the draft text, and the keyboard is shown when users return to a chat with draft content.
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)
changed the title [-]Conversation - Cursor not auto-focused in composer when returning to chat with draft[/-][+][$250] Conversation - Cursor not auto-focused in composer when returning to chat with draft[/+]on Jul 30, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.64-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@youssef-lr@JmillsExpensify@alitoshmatov / @Eskalifer1 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]
Activity
melvin-bot commentedon Jul 24, 2025
Triggered auto assignment to @JmillsExpensify (
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.Eskalifer1 commentedon Jul 24, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Conversation - Cursor not auto-focused in composer when returning to chat with draft
What is the root cause of that problem?
Currently, we do not have a logic that would allow focusing, provided that there is a draftMessage. Now, focusing is done using the canFocusInputOnScreenFocus() function, which is why focusing does not happen automatically:
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Line 119 in e26acfb
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Line 159 in e26acfb
What changes do you think we should make in order to solve the problem?
You need to add logic to focus the input if there is a draftMessage. To do this, you can do the following:
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 157 to 160 in e26acfb
Replace with (this is for the focus style):
And also add the focus itself here:
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Line 273 in e26acfb
Additionally, we will need to change the check here, if necessary:
App/src/pages/home/report/ReportActionCompose/ReportActionCompose.tsx
Lines 628 to 633 in e26acfb
I also suggest redefining the shouldFocusInputOnScreenFocus change, which will also check if there is a draftMessage.
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)
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.
ganzz4 commentedon Jul 24, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a user navigates back to a chat that has a draft message, the cursor is not automatically focused in the composer input field. This forces users to manually tap the input box to continue editing their draft, creating poor UX compared to the expected behavior where they should be able to immediately continue typing.
What is the root cause of that problem?
When users navigate back to a chat, the system doesn't check for draft messages to determine if the composer should be auto-focused:
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 635 to 640 in c593f40
The listener fires when navigating to the chat but doesn't recognize that draft content indicates the user wants to continue typing.
What changes do you think we should make in order to solve the problem?
Add draft-aware focus logic to the existing navigation focus listener in
ComposerWithSuggestions.tsx. When the navigation focus event fires, check if there's a draft message and automatically focus the composer with proper cursor positioning.App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 635 to 640 in c593f40
This ensures the composer gains focus, the cursor is positioned at the end of the draft text, and the keyboard is shown when users return to a chat with draft content.
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)
JmillsExpensify commentedon Jul 30, 2025
Opening this up to the community.
melvin-bot commentedon Jul 30, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021950475915408594604
[-]Conversation - Cursor not auto-focused in composer when returning to chat with draft[/-][+][$250] Conversation - Cursor not auto-focused in composer when returning to chat with draft[/+]47 remaining items
melvin-bot commentedon Nov 27, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Nov 27, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.2.64-5 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-12-04. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Nov 27, 2025
@youssef-lr @JmillsExpensify @alitoshmatov / @Eskalifer1 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]
melvin-bot commentedon Dec 4, 2025
Payment Summary
Upwork Job
BugZero Checklist (@JmillsExpensify)
JmillsExpensify commentedon Dec 5, 2025
Payment summary:
JmillsExpensify commentedon Dec 5, 2025
@Eskalifer1 it looks like you didn't apply to the Upwork job. I'll create a new one and offer?
Eskalifer1 commentedon Dec 5, 2025
Perhaps, but I think that simply more time has passed and this job is no longer available. Therefore, I think you can create a new one, thank you!
JmillsExpensify commentedon Dec 5, 2025
On it! Expect an offer shortly
JmillsExpensify commentedon Dec 5, 2025
Paid the Upwork contract and regression test created. Closing this one.
trjExpensify commentedon Dec 10, 2025
approved $250 for @alitoshmatov