Skip to content

fix(shortcuts): don't swallow f while typing in script editors - #36

Merged
StephenSHorton merged 1 commit into
mainfrom
fix/34-script-editor-f-key
Sep 5, 2026
Merged

StephenSHorton merged 1 commit into
mainfrom
fix/34-script-editor-f-key

Conversation

@StephenSHorton

Copy link
Copy Markdown
Owner

Fixes #34 — typing function in a custom-script trigger produced unction because the Frame Selection hotkey (f) ran on a document capture-phase listener and preventDefault'd the key.

The old gate only skipped native <input> / <textarea> / contenteditable. Monaco 0.52+ (what the Trigger Editor uses) focuses a DIV.native-edit-context inside .monaco-editor via Chromium's EditContext API, so the gate missed it.

Changes

  • Shared isTypingTarget() helper that also treats .monaco-editor / .native-edit-context / [role=textbox] as typing, and checks document.activeElement as well as e.target.
  • Viewport hotkeys (f, m, 1/2/3, Tab, Delete) also stay quiet while an editor dialog is open — same list Delete already used — so a focused trigger tree can't yank the camera either.
  • WASD pan and Escape-to-clear-selection use the same helper.

Verify

  • cd frontend && npm run check — 0 errors (pre-existing a11y/state-ref warnings only)
  • cd frontend && npm run build — clean
  • Manual: Trigger Editor → + Script → type function in the pane; all six letters insert. Bare f still frames the selection when the viewport has focus.

@claude Please review this PR, also check for security vulnerabilities

The Frame Selection hotkey bound bare f globally and only skipped
native input/textarea. Monaco 0.52+ focuses a DIV inside
.monaco-editor (EditContext), so typing function in a custom script
produced unction.

Fixes #34
@StephenSHorton StephenSHorton self-assigned this Sep 5, 2026
@StephenSHorton
StephenSHorton merged commit ca45af3 into main Sep 5, 2026
0 of 2 checks passed
@StephenSHorton
StephenSHorton deleted the fix/34-script-editor-f-key branch September 5, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Button f inside coding (scripts) not working

1 participant