Skip to content

[Due for payment 2026-05-26] [Due for payment 2026-05-26] Android - Chat - Keyboard reopens automatically after being closed via device´s back button. #90891

Closed

Description

@lanitochka17

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.3.75-1
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): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app)
App Component: Other

Action Performed:

  1. Open the Expensify app.
  2. Open any chat.
  3. Send any message to chat.
  4. Long tap and select the just send message.
  5. Select "Edit Comment"
  6. Make any edition and send it.
  7. Type another message but don´t send it.
  8. Close keyboard via device´s back button.
  9. Note that keyboard closes and reopens automatically.
  10. Close it one more time via device´s back button.
  11. Note that now, keyboard remains closed.

Expected Result:

Keyboard shouldn´t reappear after being closed using back button.

Actual Result:

Keyboard has to be closed twice if using device´s back button to close it. At first try, it closes and reopens automatically.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7155499_1778884375188.Key_Twice.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @hungvu193

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 16, 2026
  2. melvin-bot commented on May 16, 2026

    @melvin-bot

    @mountiny recently merged #90516, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on May 16, 2026

    @melvin-bot

    Triggered auto assignment to @inimaga (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. melvin-bot commented on May 16, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on May 16, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  6. OSBotify commented on May 16, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #90516 - "Allow editing messages in Composer on narrow screens V2" by @chrispader (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #90516 introduced a significant refactor of message editing in the composer. The keyboard re-opening behavior is a direct regression from this change, and the PR has already required one prior revert cycle (it was reverted in #90513 after the original #76741 introduced deploy blockers). Reverting is the safest path to unblock the deploy.

    Assigned: @chrispader (PR author), @hungvu193 @mountiny (approving reviewers)
    Labels: DeployBlockerCash kept (frontend bug in App repo). No label changes made.

    Detailed Analysis

    Evidence

    • The melvin-bot comment on the issue directly flags PR Allow editing messages in Composer on narrow screens V2 #90516 as recently merged by @mountiny, pointing to it as the suspected cause.
    • The bug is reproducible on staging only (not production), consistent with a regression introduced in the current staging deploy.
    • The issue affects Android HybridApp, and the bug occurs specifically after the message editing flow: edit a message, send it, type a new draft, close keyboard via back button — keyboard reopens automatically.
    • PR Allow editing messages in Composer on narrow screens V2 #90516 is titled "Allow editing messages in Composer on narrow screens V2" and completely refactors how the bottom composer handles message editing on narrow (mobile) layouts — exactly the affected code path.

    Verification

    • Affected files confirmed in PR Allow editing messages in Composer on narrow screens V2 #90516's file list:
      • src/pages/inbox/report/ReportActionCompose/useEditComposerToggle.ts (new file introduced by this PR)
      • src/libs/focusComposerWithDelay/requestKeyboardForFocusedComposer/index.native.ts (new file introduced by this PR)
      • src/libs/refocusComposerAfterPreventFirstResponder.ts (modified by this PR)
      • src/pages/inbox/report/ReportActionCompose/ComposerWithSuggestions.tsx (modified by this PR)
    • These files directly control keyboard focus behavior on Android.

    Root Cause

    In src/pages/inbox/report/ReportActionCompose/useEditComposerToggle.ts (line 94), when editing ends for any reason, onFocus?.() is unconditionally called. This causes the composer to request keyboard focus even when the user dismissed editing by pressing the Android back button to close the keyboard. The sequence is:

    1. User edits a message and submits it — editing state transitions out of EDITING.
    2. useEditComposerToggle's useEffect detects wasEditingRef.current is true and editing just ended.
    3. onFocus?.() is called at line 94, which triggers focus on the main composer.
    4. This focus call causes the soft keyboard to reappear on Android.
    5. The user must dismiss the keyboard a second time.

    Additionally, src/libs/focusComposerWithDelay/requestKeyboardForFocusedComposer/index.native.ts (introduced by this PR) calls KeyboardController.setFocusTo('current') via requestIdleCallback, which can re-show the IME on Android even when the user has explicitly dismissed the keyboard.

    This PR was previously reverted once (original PR #76741 reverted in #90513) due to deploy blockers, and was re-landed as v2 with fixes. The keyboard re-open regression is a new issue introduced in the v2 attempt.

  7. 5 remaining items

  8. mountiny commented on May 18, 2026

    @mountiny
    Contributor

    Waiting for a retest

  9. m-natarajan commented on May 18, 2026

    @m-natarajan

    Not Repro, Galaxy A55/ Android 16, v9.3.75-3

    repro.-.90891.mp4
  10. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on May 18, 2026
  11. changed the title [-]Android - Chat - Keyboard reopens automatically after being closed via device´s back button.[/-] [+][Due for payment 2026-05-26] Android - Chat - Keyboard reopens automatically after being closed via device´s back button.[/+] on May 19, 2026
  12. melvin-bot commented on May 19, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  13. melvin-bot commented on May 19, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.75-14 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:

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  14. melvin-bot commented on May 19, 2026

    @melvin-bot

    @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]

  15. changed the title [-][Due for payment 2026-05-26] Android - Chat - Keyboard reopens automatically after being closed via device´s back button.[/-] [+][Due for payment 2026-05-26] [Due for payment 2026-05-26] Android - Chat - Keyboard reopens automatically after being closed via device´s back button.[/+] on May 19, 2026
  16. melvin-bot commented on May 19, 2026

    @melvin-bot

    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:

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  17. melvin-bot commented on May 19, 2026

    @melvin-bot

    @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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions