Skip to content

[Bug]: Tab after typing a citation comment lands on Cancel, which breaks the keyboard-only flow #37575

Closed

Description

@balasivagn

Area: apps/web

Why this matters
Citing is a fast keyboard flow: select text, click Cite, and type the comment straight away with both hands on the keyboard. The natural next step in any form is Tab to the primary button and Enter, without going back to the mouse. In this popup Tab goes to Cancel first, so that flow either discards the comment or forces a switch back to the mouse.

Steps to reproduce

  1. Open a thread with an assistant reply. Select some of its text and click Cite.
  2. Type a comment in the popup, for example "agreed".
  3. Press Tab, then Enter (or Space), without using the mouse.

Expected behavior
Tab from the comment moves toward the primary action (Save), so Tab then Enter saves.

Actual behavior
Tab moves to Cancel, because it comes before Save in tab order. Enter then cancels: the popup closes, the comment is discarded, and the new citation chip is removed from the composer.

Enter in the comment box already saves, and Cancel removing a new citation is intended (#10379), so this is only about which button Tab reaches first.

Impact: Minor bug or occasional failure

Version or commit: main @ 83f35da

Environment: macOS, Chromium (dev web app, vp run dev), Replay (dev) agent, voice input not offered. Not checked: Safari, Firefox, packaged desktop app, voice input shown, a comment over the length limit.

Screenshots, recordings, or supporting files: a before recording is added below.

Workaround: Press Enter in the comment box to save instead of Tab.

I have a small fix ready (tabIndex={-1} on Cancel, plus a browser test; Escape and mouse still cancel). I will open a PR that links this issue once it is triaged as a bug.

before-tab-lands-on-cancel.mp4
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions