Skip to content

[Bug] Chat composer: ArrowUp/ArrowDown recall message history mid-text, blocking multi-line caret navigation #4282

Open

Description

@lazydevz-woo

Description

ChatComposerInput (the contentEditable chat composer) uses ArrowUp/ArrowDown to navigate message history regardless of the caret's position, calling preventDefault() — so in a multi-line message the caret can't move between lines. ArrowUp replaces the current draft with the previous message; ArrowDown steps through recalled history the same way.

Expected: when the caret is mid-text, ArrowUp/ArrowDown move it between lines; history is navigated only at the text boundaries — ArrowUp at the very start, ArrowDown at the very end.

Related: #2473 (planned composer state-model refactor), #3635 (chat components tracker). Happy to open a PR with a fix + tests if this is confirmed as a bug.

Reproduction

Recording (astryx.dev docs playground): multi-line draft — pressing ArrowUp mid-text replaces the draft with the previous message instead of moving the caret up a line.

2026-07-24.11.47.59.mov

Steps:

  1. Open the ChatComposerInput playground on https://astryx.atmeta.com/components/ChatComposerInput — or Storybook → Core/ChatComposerInput → Message History.
  2. Submit a couple of messages (type + Enter) to build history.
  3. Type a multi-line draft: aaa, Shift+Enter, bbb.
  4. Place the caret on the first line (or mid-text) and press ArrowUp.
  5. Expected: the caret moves up a line. Actual: the draft is replaced by the previous message; the caret can't move.

Astryx Version

@astryxdesign/[email protected]

Environment

Chrome 150.0.7871.130 (official build, arm64), macOS 26.5.1 (Tahoe), Apple M5. Keyboard interaction; not AT-specific.

Activity

  1. added
    bug
    on Jul 24, 2026
  2. cixzhang commented on Jul 28, 2026

    @cixzhang
    Contributor

    Tracked in the accessibility program tracker: #4475

  3. cixzhang commented on Jul 28, 2026

    @cixzhang
    Contributor

    Tracked in the accessibility program tracker: #4475

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions