Skip to content

[$250] iOS - Chat does not scroll down to show edit composer, suggestion list is hidden behind keyboard #64085

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.1.65-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: N/A
Email or phone of affected tester (no customers): jsdonisjondjosd@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

Precondition:

  • Have at least a workspace
  1. Launch Expensify app
  2. Open FAB > Create report
  3. Send a message in the empty report
  4. Long tap on the message > Edit comment
  5. Tap outside the composer to close the keyboard
  6. Tap on the edit composer
  7. Note that the report view does not scroll down to reveal the edit composer
  8. Type @ or :sm in the edit composer

Expected Result:

In Step 7, the report view will scroll down to reveal the edit composer when the edit composer is focused
In Step 8, the suggestion list will appear above the edit composer

Actual Result:

In Step 7, the report view does not scroll down to reveal the edit composer when the edit composer is focused
In Step 8, the suggestion list is partially hidden behind the keyboard

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
Bug6858035_1749736661403.ScreenRecording_06-12-2025_21-52-15_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021933546424749852553
  • Upwork Job ID: 1933546424749852553
  • Last Price Increase: 2025-06-13
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jun 12, 2025
  2. melvin-bot commented on Jun 12, 2025

    @melvin-bot

    Triggered auto assignment to @joekaufmanexpensify (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.

  3. thelullabyy commented on Jun 13, 2025

    @thelullabyy
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    • Chat does not scroll down to show edit composer

    What is the root cause of that problem?

    • We already have logic to scroll to the editing message on focus:

      InteractionManager.runAfterInteractions(() => {
      requestAnimationFrame(() => {
      reportScrollManager.scrollToIndex(index, true);
      });
      });

    • The scrollToIndex function being used:

      flatListRef.current.scrollToIndex({index});

      defaults the viewPosition to 0. According to the documentation:

      scrollToIndex: Scrolls to the item at the specified index such that it is positioned in the viewable area.
      viewPosition of 0 places it at the top, 1 at the bottom, and 0.5 centers it.
      Cannot scroll to locations outside the render window without getItemLayout.

    • This works well for InvertedFlatList, but on the page experiencing this bug, we are using a regular FlatList. Thus, viewPosition: 0 causes the item to be scrolled to the top, which is not ideal when trying to reveal the composer near the bottom of the screen.

    What changes do you think we should make in order to solve the problem?

    
    const scrollToIndex = useCallback(
        (index: number, isEditing?: boolean, isInvertedList?: true) => {
            if (!flatListRef?.current) {
                return;
            }
    
            flatListRef.current.scrollToIndex({ index, viewPosition: isInvertedList ? 0 : 1 });
        },
        [flatListRef],
    );
    
    • When calling scrollToIndex in contexts using FlatList, explicitly pass the third parameter as false to ensure the item is scrolled into view at the bottom.

    • Additionally, the current logic attempts to ensure the keyboard is visible before calling scrollToIndex using InteractionManager.runAfterInteractions and requestAnimationFrame. However, these do not guarantee the keyboard is fully visible

      InteractionManager.runAfterInteractions(() => {
      requestAnimationFrame(() => {
      reportScrollManager.scrollToIndex(index, true);
      });
      });

    • Instead, we should use the waitForKeyboardToShow utility introduced here:
      withKeyboardState.tsx

    
    const waitForKeyboardToShow = useCallback((): Promise<void> => {
        return new Promise((resolve) => {
            if (isKeyboardActive || !isKeyboardAnimatingRef.current) {
                resolve();
                return;
            }
    
            const subscription = KeyboardEvents.addListener('keyboardDidShow', () => {
                resolve();
                subscription.remove();
            });
        });
    }, [isKeyboardActive]);
    
    • Replace the current scrolling logic with the following to ensure scrolling occurs only after the keyboard is fully visible:
    
    waitForKeyboardToShow().then(() => {
        reportScrollManager.scrollToIndex(index, true);
    });
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    • NA
  4. joekaufmanexpensify commented on Jun 13, 2025

    @joekaufmanexpensify
    Contributor

    Reproduced.

  5. changed the title [-]iOS - Chat does not scroll down to show edit composer, suggestion list is hidden behind keyboard[/-] [+][$250] iOS - Chat does not scroll down to show edit composer, suggestion list is hidden behind keyboard[/+] on Jun 13, 2025
  6. melvin-bot commented on Jun 13, 2025

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jun 13, 2025
  8. melvin-bot commented on Jun 13, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @shubham1206agra (External)

  9. shubham1206agra commented on Jun 13, 2025

    @shubham1206agra
    Contributor

    @kirillzyusko Would you like to look into this? Since you implemented keyboard behavior in iOS.

  10. kirillzyusko commented on Jun 13, 2025

    @kirillzyusko
    Contributor

    @shubham1206agra I'm currently busy with other work, but I believe @chrispader or @perunt can help here 😊🙌

  11. chrispader commented on Jun 16, 2025

    @chrispader
    Contributor

    i'll be able to look into this by the end of the week. If this needs to be handled more urgently, maybe @perunt or somebody else can work on this! 🙌🏼

  12. 176 remaining items

  13. melvin-bot commented on Jun 2, 2026

    @melvin-bot

    @hungvu193 Whoops! This issue is 2 days overdue. Let's get this updated quick!

  14. hungvu193 commented on Jun 4, 2026

    @hungvu193
    Contributor

    I think this is ready for payment. I'll post the summary soon.

  15. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    on Jun 4, 2026
  16. melvin-bot commented on Jun 4, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  17. hungvu193 commented on Jun 4, 2026

    @hungvu193
    Contributor

    Hi there, we've been working on this feature for the last couple of months and I'd like to propose increasing the bounty of this issue with the following information.

    Proposed amount to increase the price to: $1500
    Multiple PRs:

    Additional fixes:
    Beyond implementing the new editing experience, several follow-up issues were identified and resolved:

    • Editing permissions in Admin-only chats
    • Keyboard behavior after cancelling edit mode
    • Composer focus/highlight state after editing
    • Autocorrection timing before message submission
      These fixes addressed edge cases discovered during testing and rollout, extending well beyond the original implementation.

    Scope expansion
    The work evolved from introducing a new editing experience for small-screen devices into a broader refactor of the composer architecture. To support the feature cleanly, ReportActionCompose was restructured into more compositional components, enabling a dedicated EditOnlyReportActionCompose flow and improving maintainability of the editing system.

    The final delivered scope was significantly larger than a straightforward UI change.

    Core flow changes:
    We modified the core functionality of the app, the way the user edits messages.

    Deploy blockers audited:
    The feature touched a core messaging experience and required auditing of related editing and composition flows to identify and resolve regressions before rollout. Multiple deploy-blocking issues were discovered and addressed through follow-up PRs.

    Performance impact:
    While performance optimization was not the primary goal, the work involved substantial refactoring of composition and editing components to support the new editing architecture while maintaining responsiveness and behavior consistency across platforms.

    Test coverage:
    Testing covered a large number of scenarios, including:

    1. Editing messages on small-screen devices
    2. Submitting edited messages with autocorrection enabled
    3. Cancelling edits
    4. Keyboard open/close behavior
    5. Navigation interactions using device back buttons
    6. Composer focus states after editing
    7. Editing in Admin-only chats
    8. Cross-platform behavior validation
    9. Regression testing of existing compose and edit flows

    Files touched:

    • 86 files on the main PR.
    • Several follow up PRs.
  18. mallenexpensify commented on Jun 5, 2026

    @mallenexpensify
    Contributor

    @mountiny 👀 on @hungvu193 's proposed price increase above.

    @hungvu193 thanks for posting a thorough breakdown.

  19. mountiny commented on Jun 5, 2026

    @mountiny
    Contributor

    Looks good to me, this was very complex change

  20. mallenexpensify commented on Jun 6, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @hungvu193 due $1500 via NewDot

    Thx!

  21. JmillsExpensify commented on Jun 6, 2026

    @JmillsExpensify
    Contributor

    $1,500 approved for @hungvu193

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions