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
[$250] [Due for payment 2026-01-29] Editing Previous Message with Up Arrow Does Not Move Keyboard Focus to Editor #78475
Version Number: 9.2.86-6 Reproducible in staging?: Needs Reproduction (Unable to reproduce) Reproducible in production?: Needs Reproduction If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@quinthar Slack conversation (hyperlinked to channel name): #Quality
Action Performed:
Navigate to any chat
Send a message
Press the Up Arrow key to edit the previous message
Expected Result:
The previous message opens in edit mode.
Keyboard focus automatically moves to the message editor so the user can immediately start typing.
Actual Result:
The previous message opens in edit mode
Keyboard focus does not move to the editor
Keyboard focus is in the compose field
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
What changes do you think we should make in order to solve the problem?
This logic was added in PR #59397 to ensure that the TextInput focus is delayed until the SidePanelModal is actually closed and the keyboard displays properly.
We need to refactor slightly to ensure the modal id is only set when the SidePanelModal is closing:
Please re-state the problem that we are trying to solve in this issue.
With the Concierge side panel open, pressing Up to edit the previous message opens the inline editor but the input is not focused.
What is the root cause of that problem?
Two things prevent focus from landing where it should:
When Up key triggers inline edit inside the side panel, the focus manager is kept blocked while the panel is open (on web via the SidePanelModal mount effect), so the inline editor mounts unfocused and the user cannot type immediately.
When cancelling an edit (Esc/save), we always ask the main composer to focus and never target the side panel composer, so focus jumps away from Concierge after closing the inline editor.
What changes do you think we should make in order to solve the problem?
We need to fix two things here:
When pressing the up key to edit the previous message, the focus should go to that message so that the user can directly start typing.
After the editing is done and the user presses the Enter key, or if the user cancels the edit via the Esc key -> then the focus should go back to the composer of the same section. If editing is being done in main chat, then it should go to the main chat. Else, if editing is happening in the Concierge side panel, then focus should go back to the composer of the side panel.
To achieve the above, we can allow exact focus requests when the side panel is open, auto-focus the inline edit input when it mounts, and when leaving edit mode focus the correct composer based on whether the edit happened in main chat or the Concierge side panel.
// src/pages/home/report/ReportActionItemMessageEdit.tsx// detect Concierge side-panel edits and auto-focus the inline editorconst[conciergeReportID]=useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID,{canBeMissing: true});const{shouldHideSidePanel}=useSidePanel();constisConciergeSidePanelContext=useMemo(()=>conciergeReportID===reportID&&!shouldHideSidePanel,[conciergeReportID,reportID,shouldHideSidePanel],);useEffect(()=>{if(!textInputRef.current){return;}focus(true);},[focus]);// focus the right composer after cancellingconstdeleteDraft=useCallback(()=>{deleteReportActionDraft(reportID,action);if(isActive()){ReportActionComposeFocusManager.clear(true);InteractionManager.runAfterInteractions(()=>{if(isConciergeSidePanelContext){focusComposerWithDelay(ReportActionComposeFocusManager.composerRef.current)(true);}else{ReportActionComposeFocusManager.focus(true);}});}// scrolling logic unchanged},[action,index,reportID,reportScrollManager,isActive,isConciergeSidePanelContext]);
// src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx// let explicit focus requests through even when the side panel is openconstsetUpComposeFocusManager=useCallback((shouldTakeOverFocus=false)=>{ReportActionComposeFocusManager.onComposerFocus((shouldFocusForNonBlurInputOnTapOutside=false)=>{if((!willBlurTextInputOnTapOutside&&!shouldFocusForNonBlurInputOnTapOutside)||!isFocused){return;}if(!isSidePanelHiddenOrLargeScreen&&!shouldFocusForNonBlurInputOnTapOutside){return;}focus(true);},shouldTakeOverFocus);},[focus,isFocused,isSidePanelHiddenOrLargeScreen],);
// src/components/SidePanel/SidePanelContextProvider.tsx// reset and allow focus when closing the side panelconstuniqueModalId=useRef(ComposerFocusManager.getId()).current;constcloseSidePanel=useCallback((shouldUpdateNarrow=false)=>{if(!sidePanelNVP){return;}setIsSidePanelTransitionEnded(false);SidePanelActions.closeSidePanel(!isExtraLargeScreenWidth||shouldUpdateNarrow);focusComposerWithDelay(ReportActionComposeFocusManager.composerRef.current,CONST.SIDE_PANEL_ANIMATED_TRANSITION+CONST.COMPOSER_FOCUS_DELAY)(true);ComposerFocusManager.resetReadyToFocus(uniqueModalId);setTimeout(()=>ComposerFocusManager.setReadyToFocus(uniqueModalId),CONST.SIDE_PANEL_ANIMATED_TRANSITION);},[isExtraLargeScreenWidth,sidePanelNVP,uniqueModalId],);
We also need to remove the SidePanelModal mount/unmount effect that keeps ComposerFocusManager in a "not ready" state while the panel is open. That effect blocked inline editor focus; we now reset and re-allow focus when the side panel closes in SidePanelContextProvider.
📣 @linhvovan29546 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
Activity
melvin-bot commentedon Dec 26, 2025
Triggered auto assignment to @garrettmknight (
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.MelvinBot commentedon Dec 26, 2025
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
samranahm commentedon Dec 26, 2025
Unable to reproduce.
linhvovan29546 commentedon Dec 27, 2025
I can reproduce the issue. Steps to reproduce:
Concierge.Screen.Recording.2025-12-27.at.11.09.08.mov
Please assign me as C+ based on the Slack message: https://expensify.slack.com/archives/C02NK2DQWUX/p1766762914499179
dmkt9 commentedon Dec 27, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Editing Previous Message with Up Arrow Does Not Move Keyboard Focus to Editor
What is the root cause of that problem?
When the draft message edit composer is opened for editing, it should be focused using
focusComposerWithDelayhere:App/src/pages/home/report/PureReportActionItem.tsx
Line 608 in 0d08b03
However, inside
focusComposerWithDelay,ComposerFocusManager.isReadyToFocus()never resolves, so the focus function is never called:App/src/libs/focusComposerWithDelay/index.ts
Line 31 in 0d08b03
When
SidePanelModalis always open, the modal id is only set but never cleared, which causesComposerFocusManager.isReadyToFocus()to never resolve:App/src/components/SidePanel/SidePanelModal/index.tsx
Lines 52 to 58 in 0d08b03
What changes do you think we should make in order to solve the problem?
This logic was added in PR #59397 to ensure that the TextInput focus is delayed until the SidePanelModal is actually closed and the keyboard displays properly.
We need to refactor slightly to ensure the modal id is only set when the
SidePanelModalis closing:App/src/components/SidePanel/SidePanelModal/index.tsx
Lines 52 to 58 in 0d08b03
What alternative solutions did you explore? (Optional)
Or apply this logic only for narrow screens:
App/src/components/SidePanel/SidePanelModal/index.tsx
Lines 52 to 58 in 0d08b03
ShridharGoel commentedon Dec 28, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
With the Concierge side panel open, pressing Up to edit the previous message opens the inline editor but the input is not focused.
What is the root cause of that problem?
Two things prevent focus from landing where it should:
See this:
App/src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.tsx
Lines 595 to 606 in 466a83d
and this:
App/src/components/SidePanel/SidePanelModal/index.tsx
Lines 51 to 58 in 466a83d
App/src/pages/home/report/ReportActionItemMessageEdit.tsx
Lines 279 to 286 in 466a83d
What changes do you think we should make in order to solve the problem?
We need to fix two things here:
To achieve the above, we can allow exact focus requests when the side panel is open, auto-focus the inline edit input when it mounts, and when leaving edit mode focus the correct composer based on whether the edit happened in main chat or the Concierge side panel.
We also need to remove the SidePanelModal mount/unmount effect that keeps
ComposerFocusManagerin a "not ready" state while the panel is open. That effect blocked inline editor focus; we now reset and re-allow focus when the side panel closes inSidePanelContextProvider.So this will be removed:
App/src/components/SidePanel/SidePanelModal/index.tsx
Lines 51 to 58 in 466a83d
Test branch
Link
Screen.Recording.2025-12-28.at.1.53.34.PM.mov
37 remaining items
melvin-bot commentedon Jan 31, 2026
Current assignees @linhvovan29546 and @aimane-chnaif are eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Jan 31, 2026
📣 @aimane-chnaif 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
melvin-bot commentedon Jan 31, 2026
📣 @linhvovan29546 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖
garrettmknight commentedon Jan 31, 2026
@aimane-chnaif / @linhvovan29546 please accept the offers.
garrettmknight commentedon Feb 3, 2026
@linhvovan29546 please accept the offer.
garrettmknight commentedon Feb 3, 2026
Payment Summary
linhvovan29546 commentedon Feb 4, 2026
I didn’t work on this one