Repository navigation
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.2.63-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: #74916
Email or phone of affected tester (no customers): dreamnitethedragon+yydyd373@gmail.com
**Issue reported by:**Applause - Internal Team
Action Performed:
- Launch app
- Open chat
- Enter @ and select a mention
- Note after selecting mention, suggestion box is closed
- In next line enter a text
- Leave next line as empty space
- In next line enter a text
- In next line enter @ and select a mention
9.Note after selecting mention, suggestion box is closed - Now in empty space (step 6) enter @ and select a mention from suggestion box
- Now note suggestion box is not closed
Expected Result:
After selecting a mention from the suggestion box in any line (including lines that were previously empty), the suggestion box should close automatically — same behavior as seen when selecting mentions in other lines
Actual Result:
When a mention is selected in a line that was previously left empty (Step 10), the suggestion box remains open and does not close automatically
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Platforms Tested:
On which of our officially supported platforms was this issue tested:- Android: App
- Android: mWeb Chrome
- iOS: App
- iOS: mWeb Safari
- iOS: mWeb Chrome
- Windows: Chrome
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Bug7013060_1764076830686.Screenrecorder-2025-11-25-18-42-35-518.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~021994258802785673429
- Upwork Job ID: 1994258802785673429
- Last Price Increase: 2026-01-02
Issue Owner
Current Issue Owner: @huultMetadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
melvin-bot commentedon Nov 25, 2025
Triggered auto assignment to @VictoriaExpensify (
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.abbasifaizan70 commentedon Nov 25, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-11-28 20:35:28 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When selecting a mention from the suggestion box in a line that was previously left empty on Android native, the suggestion box remains open and does not close automatically. This is inconsistent with the expected behavior where the suggestion box should close after selecting a mention in any line. This issue only occurs on Android native; it works correctly on iOS native and web platforms.
What is the root cause of that problem?
The root cause is specific to Android native: after selecting a mention,
onSelectionChangeis triggered twice with different selection values, which doesn't happen on iOS native or web platforms. This double-trigger causes the suggestion calculation to run incorrectly and reopen the suggestion box.Why this happens on Android native:
insertSelectedMentionupdates the comment value and selection positiononSelectionChangeis triggered twice with different selection values after the mention is insertedonSelectionChangehas one set of selection valuesonSelectionChangehas different selection values (this is the Android native specific behavior)onSelectionChangetriggers theuseEffecthook which callsdebouncedCalculateMentionSuggestioncalculateMentionSuggestionto run again, and when the cursor is positioned right after the inserted mention code (which contains an@symbol), the function detects the@symbol again and reopens the suggestion boxWhy it works on iOS native and web:
onSelectionChangeis triggered only once after inserting a mention, with consistent selection valuesComparison:
onSelectionChangefires twice with different values → suggestion box reopensonSelectionChangefires once with consistent values → suggestion box closes correctlyWhat changes do you think we should make in order to solve the problem?
Add Android native platform detection: Import
getPlatformto detect when running on Android native.In
App/src/pages/home/report/ReportActionCompose/SuggestionMention.tsx:Block suggestion calculation on Android native after insertion: In
insertSelectedMention, on Android native, set flags to temporarily block the debounced calculation and ignore the next selection change.In
App/src/pages/home/report/ReportActionCompose/SuggestionMention.tsx:Add insertion position check in calculation for Android native: In
calculateMentionSuggestion, add an early return check that prevents showing suggestions when the cursor is at the exact position where a mention was just inserted on Android native.In
App/src/pages/home/report/ReportActionCompose/SuggestionMention.tsx:Add onSelectionChange handler for Android native: Add an
onSelectionChangemethod to track selection changes on Android native and work with the insertion position check.In
App/src/pages/home/report/ReportActionCompose/SuggestionMention.tsx:Expose onSelectionChange in useImperativeHandle: Add
onSelectionChangeto the exposed methods so it can be called from the parent component.In
App/src/pages/home/report/ReportActionCompose/SuggestionMention.tsx:What alternative solutions did you explore? (Optional)
N/A
Demo
Screen.Recording.2025-11-29.at.1.32.29.AM.mov
[-]Сhat - Mention suggestion box does not close when selecting mention in previously empty line[/-][+][$250] Сhat - Mention suggestion box does not close when selecting mention in previously empty line[/+]melvin-bot commentedon Nov 28, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021994258802785673429
melvin-bot commentedon Nov 28, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @huult (
External)41 remaining items
mvtglobally commentedon Dec 27, 2025
Issue not reproducible during KI retests. (Third week)
huult commentedon Dec 29, 2025
Same as above
melvin-bot commentedon Jan 1, 2026
@huult Whoops! This issue is 2 days overdue. Let's get this updated quick!
huult commentedon Jan 2, 2026
Same as above
melvin-bot commentedon Jan 2, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
mvtglobally commentedon Jan 4, 2026
Issue not reproducible during KI retests. (Fourth week)
huult commentedon Jan 5, 2026
Same as above
VictoriaExpensify commentedon Jan 5, 2026
Sorry I missed your tags @huult . Closing this out since it cannot be reproduced