Skip to content

[Bug]: Cutting text in the iOS composer cannot be undone #37157

Closed

Description

@StiensWout

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/mobile

Steps to reproduce

In the iOS native composer, type hello world, select world, Cut, then Undo.

The deterministic UIKit reproduction mounts the real composer in a scene/window, makes its text view first responder, calls insertText("hello world"), clears prior undo actions to isolate Cut, selects NSRange(location: 6, length: 5), calls cut(nil), then undoManager.undo(). A vanilla UITextView in the same fixture is the control.

Expected behavior

Undo restores hello world, and Redo removes world again. Cutting a context chip should also be undoable.

Actual behavior

The composer cannot undo the cut and retains hello ; vanilla UITextView records an undo and restores the original text. Cut edits textStorage directly, bypassing UIKit undo registration.

Impact

Minor bug or occasional failure

Version or commit

Reproduced on main f0a33213547ce81ea9c39e4bedb13829cf307f56; editor unchanged on latest fetched main d8c7855a884c58715c2d66ca82a3334bd6bc398c.

Environment

iPhone 18 Pro simulator, iOS 27.0, Xcode 27.2. Real UIKit scene/window and clipboard; Expo bridge stubbed for the isolated reproduction.

Logs or stack traces

plainCanUndo: true; plainAfterUndo: "hello world"; composerCanUndo: false; composerAfterUndo: "hello ".

Found by the Composer Improvements and Fixes hunt and independently rebuilt and confirmed by Claude Opus 5.5. The isolated reproduction does not claim physical keyboard or edit-menu dispatch coverage.

Workaround

Paste the cut text back manually.

Activity

  1. added
    vouch:trusted
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    vouch:trusted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions