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 2026-05-26] Chat - Composer is refocused but not highlighted after deleting message via keyboard #90841
Version Number: 9.3.75 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#90516 Email or phone of affected tester (no customers):jsnodjosndjoisnjidoj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Chat Report View
Action Performed:
Go to staging.new.expensify.com
Open any chat.
Send a message.
Press keyboard up arrow.
Clear the composer and hit Enter twice.
Expected Result:
Composer will be refocused and highlighted.
Actual Result:
Composer is refocused but not highlighted after deleting message via keyboard.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
PR #90516 introduced a regression in focusComposerWithDelay that skips calling input.focus() when the composer is already focused, relying instead on requestKeyboardForFocusedComposer — which is a NOOP on web — causing the composer to not visually highlight after a message delete-via-keyboard flow.
Assigned: @chrispader (PR author), @mountiny and @hungvu193 (approving reviewers) from PR #90516 Labels: DeployBlockerCash kept (frontend App regression). DeployBlocker not present, no change needed.
PR Allow editing messages in Composer on narrow screens V2 #90516 modified focusComposerWithDelay to add a new branch: when the composer is already focused (getIsFocused() returns true), it calls requestKeyboardForFocusedComposer instead of input.focus()
requestKeyboardForFocusedComposer/index.ts (the web implementation) is defined as a NOOP (const NOOP = () => {})
Previously, the code always called textInput.focus() unconditionally, which triggers the browser's visual focus highlight
Root Cause
In the old code, focusComposerWithDelay always called textInput.focus() regardless of current focus state. In PR #90516's refactor, a new focusAndUpdateSelection inner function was introduced that short-circuits early when getIsFocused() is true — skipping input.focus() entirely and delegating to requestKeyboardForFocusedComposer. On web, requestKeyboardForFocusedComposer is a NOOP. This means that after a message is deleted via the edit+clear+Enter flow, when useEditComposerToggle calls onFocus() to re-highlight the composer, the focus call is silently dropped because the DOM element is already technically focused. The browser does not re-apply the visual highlight (CSS :focus / focus ring) unless focus() is called again.
The exact flow:
User presses up-arrow to enter edit mode (editingState = EDITING)
User clears text and presses Enter — publishDraft with empty message triggers the delete confirmation modal
User confirms deletion — deleteDraft() calls stopEditing() setting editingState = OFF
useEditComposerToggle detects editing ended and calls onFocus?.() (line 94)
handleEditFocus invokes focus(true, undefined, true) with forceKeyboardIfAlreadyFocused = true
Inside focusComposerWithDelay, getIsFocused() returns true (composer DOM element was already active), so input.focus() is skipped
requestKeyboardForFocusedComposer (NOOP on web) is called instead — no visual update occurs
The composer appears refocused but not highlighted
changed the title [-]Chat - Composer is refocused but not highlighted after deleting message via keyboard[/-][+][Due for payment 2026-05-26] Chat - Composer is refocused but not highlighted after deleting message via keyboard[/+]on May 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.77-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@hungvu193 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 May 15, 2026
@mountiny recently merged #90516, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon May 15, 2026
Triggered auto assignment to @marcaaron (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.melvin-bot commentedon May 15, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon May 15, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon May 15, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #90516 - "Allow editing messages in Composer on narrow screens V2" by @chrispader (High confidence)
Related Issues: #64085, #90512, #90444, #90492, #90435, #90433, #90431, #90430
Recommendation: REVERT
PR #90516 introduced a regression in
focusComposerWithDelaythat skips callinginput.focus()when the composer is already focused, relying instead onrequestKeyboardForFocusedComposer— which is a NOOP on web — causing the composer to not visually highlight after a message delete-via-keyboard flow.Assigned: @chrispader (PR author), @mountiny and @hungvu193 (approving reviewers) from PR #90516
Labels:
DeployBlockerCashkept (frontend App regression).DeployBlockernot present, no change needed.Detailed Analysis
Evidence
Verification
src/libs/focusComposerWithDelay/index.ts— this file was modified by PR Allow editing messages in Composer on narrow screens V2 #90516focusComposerWithDelayto add a new branch: when the composer is already focused (getIsFocused()returns true), it callsrequestKeyboardForFocusedComposerinstead ofinput.focus()requestKeyboardForFocusedComposer/index.ts(the web implementation) is defined as a NOOP (const NOOP = () => {})textInput.focus()unconditionally, which triggers the browser's visual focus highlightRoot Cause
In the old code,
focusComposerWithDelayalways calledtextInput.focus()regardless of current focus state. In PR #90516's refactor, a newfocusAndUpdateSelectioninner function was introduced that short-circuits early whengetIsFocused()is true — skippinginput.focus()entirely and delegating torequestKeyboardForFocusedComposer. On web,requestKeyboardForFocusedComposeris a NOOP. This means that after a message is deleted via the edit+clear+Enter flow, whenuseEditComposerTogglecallsonFocus()to re-highlight the composer, the focus call is silently dropped because the DOM element is already technically focused. The browser does not re-apply the visual highlight (CSS:focus/ focus ring) unlessfocus()is called again.The exact flow:
editingState = EDITING)publishDraftwith empty message triggers the delete confirmation modaldeleteDraft()callsstopEditing()settingeditingState = OFFuseEditComposerToggledetects editing ended and callsonFocus?.()(line 94)handleEditFocusinvokesfocus(true, undefined, true)withforceKeyboardIfAlreadyFocused = truefocusComposerWithDelay,getIsFocused()returnstrue(composer DOM element was already active), soinput.focus()is skippedrequestKeyboardForFocusedComposer(NOOP on web) is called instead — no visual update occurs8 remaining items
melvin-bot commentedon May 19, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".[-]Chat - Composer is refocused but not highlighted after deleting message via keyboard[/-][+][Due for payment 2026-05-26] Chat - Composer is refocused but not highlighted after deleting message via keyboard[/+]melvin-bot commentedon May 19, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.77-3 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 2026-05-26. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon May 19, 2026
@hungvu193 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]
hungvu193 commentedon May 25, 2026
Regression from #90516. We can close