Skip to content

BUG: Cmd+A does not select all text in Preview tab raw editor textarea #183

Open

Description

@jeonghun-jj-lee

Summary

Cmd+A (select all) does not highlight/select text in the Preview tab's raw editor textarea. The textarea is a native <textarea> element, and the app's command system in command.tsx has a guard that should bail early for clipboard chords (Cmd+A/Z/C/V/X) when the target is an editable element (isEditableTarget checks target.closest("input, textarea, select")). Despite this, Cmd+A appears to be intercepted.

Context

  • App version: 1.18.12
  • OS: Darwin 25.5.0 arm64
  • Component: packages/app/src/components/session/session-preview-tab.tsx (RawEditor)
  • The raw editor uses a native <textarea> with el.addEventListener("keydown", ...) and stopPropagation() for Cmd/Ctrl chords — but the command system's handler uses capture: true on document, so it fires first in the capture phase before the element's bubble-phase listener.

Expected vs actual

  • Expected: Cmd+A selects all text in the textarea (native browser behavior)
  • Actual: Nothing happens — text is not selected
Diagnostics
  • The command system handler (packages/app/src/context/command.tsx:432) is registered with { capture: true } on document
  • Its guard at line 413: if (isEditableTarget(event.target) && isClipboardChord && !isPalette) return — should bail for Cmd+A in a textarea
  • isEditableTarget (line 256) checks target.closest("input, textarea, select") — should match
  • isClipboardChord includes "a" in its key list
  • A native el.addEventListener("keydown", ...) was added to the textarea with stopPropagation() but this fires in bubble phase — after the capture-phase command handler
  • selection:bg-blue-500/30 was added to verify selection isn't just invisible — it genuinely isn't selecting

intake: not-ready — mature per the maturity contract before picking up
suggested_path: A
diagnostics: inline

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions