Skip to content

feat(hotkeys): Let function and media keys fire in text fields - #299

Merged
KevinVandy merged 2 commits into
mainfrom
feat/auto-ignore-inputs-non-typing-keys
Nov 25, 2026
Merged

KevinVandy merged 2 commits into
mainfrom
feat/auto-ignore-inputs-non-typing-keys

Conversation

@KevinVandy

@KevinVandy KevinVandy commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

🎯 Changes

  • With the default ignoreInputs: 'auto', hotkeys on function keys (F1 to F24) and media keys (names that start with Audio, Browser, Launch, or Media) now fire while a text field or a key-owning widget has focus, with any modifiers. Before, an F5 or Shift+F10 hotkey was skipped in a text field and the browser acted on the key. The rule lives in getDefaultIgnoreInputs in packages/hotkeys/src/_registration.ts.
  • A sequence follows its first step, so ['F2', 'R'] now also fires in text fields, and its later keys don't type into the field. The changeset, the defaults guide, and every framework's sequences guide say so.
  • The defaults guide and the ignoreInputs JSDoc now warn that Control and Meta chords can take over text editing shortcuts such as Mod+Z, and explain why 'auto' doesn't detect them. Quick-start and guide examples that registered undo and redo next to a <textarea> now use other Mod chords.
  • Unit tests cover F-key and media-key chords, physical [F2] bindings, out-of-range names (F0, F25, Fn, Find), and an F-key sequence typed in an input. An e2e case in focus.spec.ts presses F2, Shift+F10, and MediaPlayPause in text fields in all three engines.

Notes

This is a behavior change under the default options, so it ships as a minor. Apps that relied on an F-key hotkey being skipped in text fields can set ignoreInputs: true on it.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
  • I fully understand the code in this pull request, including any code generated with AI assistance.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • New Features
    • Function-key and media-key hotkeys, including sequences that start with these keys, now work in text fields with the default input behavior. Later sequence keys won’t be entered into the field.
    • Set ignoreInputs: true to keep hotkeys from firing in text fields.
  • Documentation
    • Updated hotkey guidance and examples across supported frameworks, including examples for publishing and duplicating.

`ignoreInputs: 'auto'` exists so people can type without triggering
shortcuts. Function keys and media keys type nothing, so a hotkey on one
of them now fires while a text field has focus, with any modifiers.
Before, an `F5` or `Shift+F10` hotkey was skipped in a text field and
the browser acted on the key instead. Media keys are the keys whose
names start with `Audio`, `Browser`, `Launch`, or `Media`.

A sequence follows its first step, so a sequence that starts with a
function key no longer skips later steps in text fields or widgets.

The defaults guide and the `ignoreInputs` JSDoc now warn that Control
and Meta chords can replace text editing shortcuts such as `Mod+Z`, and
say why `'auto'` does not detect them. The "register several hotkeys"
example no longer registers undo and redo beside a textarea.
…sequences

The non-typing key pattern matched any name that starts with `F` and a
digit, so `F0` or `F25` registered from JavaScript also fired in text
fields. It now matches `F1` to `F24` only.

A sequence that starts with a function key, such as `['F2', 'R']`, now
fires in text fields, and its later keys don't type into the field. The
changeset, the defaults guide, and the sequences guides now say so, and
a test covers it.
@changeset-bot

changeset-bot Bot commented Nov 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 637a2d0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@tanstack/hotkeys Minor
@tanstack/alpine-hotkeys Patch
@tanstack/angular-hotkeys Patch
@tanstack/ember-hotkeys Patch
@tanstack/hotkeys-devtools Patch
@tanstack/lit-hotkeys Patch
@tanstack/octane-hotkeys Patch
@tanstack/preact-hotkeys Patch
@tanstack/react-hotkeys Patch
@tanstack/solid-hotkeys Patch
@tanstack/svelte-hotkeys Patch
@tanstack/vue-hotkeys Patch
@tanstack/angular-hotkeys-devtools Patch
@tanstack/preact-hotkeys-devtools Patch
@tanstack/react-hotkeys-devtools Patch
@tanstack/solid-hotkeys-devtools Patch
@tanstack/svelte-hotkeys-devtools Patch
@tanstack/vue-hotkeys-devtools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default ignoreInputs: 'auto' filter now allows function and media keys in text fields, including as the first key in a sequence. Tests cover the filter and focused fields. Guides and framework examples document the behavior and related input options.

Changes: Input Hotkey Defaults

Layer / File(s) Summary
Input filtering and validation
packages/hotkeys/src/_registration.ts, packages/hotkeys/src/hotkey-manager.ts, packages/hotkeys/tests/*, e2e/browser/focus.spec.ts
The default filter allows F1–F24 and keys with Audio, Browser, Launch, or Media prefixes in inputs, including with modifiers. Tests cover matching key values and codes, keys that remain ignored, sequences beginning with F2, and focused input, textarea, and contenteditable elements.
Guidance, examples, and release records
docs/guides/sensible-defaults.md, docs/framework/*/guides/*, docs/framework/*/quick-start.md, packages/hotkeys/skills/hotkeys-core/SKILL.md, .changeset/*, .intent/review-state.json
The guides describe function- and media-key behavior, function-key-started sequences, and options for preserving text-field editing. Framework examples replace undo and redo shortcuts with publish and duplicate shortcuts. The changeset declares a minor release, and review-state records update snapshots and rationales.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Suggested reviewers: schiller-manuel, alemtuzlak

Merge Risk: Minimal · up to 637a2 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: function and media keys now fire in text fields. It uses the conventional feat(hotkeys) scope and matches the changeset, the _registration.ts rule change, and the test…
Description check Passed The description follows the template. It has a Changes section that explains the behavior change, the sequence rule, the guide updates, and the tests. The checklist is filled in. It leaves the local p…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: function and media keys now fire in text fields. It uses the conventional feat(hotkeys) scope and matches the changeset, the _registration.ts rule change, and the tests. It is short and specific.

Full details: Description check

Explanation

The description follows the template. It has a Changes section that explains the behavior change, the sequence rule, the guide updates, and the tests. The checklist is filled in. It leaves the local pnpm run test:pr box unchecked, and it does not say whether the e2e and unit tests were run locally. Both Release Impact items are addressed: a changeset is present and the change is published code. Those gaps are minor and do not block merge.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit taps F2 with care,
Then Media keys ring through the air.
The field stays focused, keys take flight,
A sequence follows, clean and right.
The guide now shows the path to hop,
Then carrots mark the testing stop.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 581b219 and 637a2d0.

Files ignored due to path filters: 19

  • docs/reference/classes/HotkeyManager.md is excluded by !docs/**/reference/**
  • docs/reference/functions/getHotkeyManager.md is excluded by !docs/**/reference/**
  • docs/reference/functions/toHotkeyRegistrationView.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/ActivateHotkeyScopeOptions.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyChordOptions.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyChordRegistration.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyChordRegistrationView.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyOptions.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyRegistrationHandle.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyRegistrationsResult.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeyScopesState.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeySequenceOptions.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeySequenceRegistration.md is excluded by !docs/**/reference/**
  • docs/reference/interfaces/HotkeySequenceRegistrationView.md is excluded by !docs/**/reference/**
  • docs/reference/type-aliases/HotkeyCommonOptions.md is excluded by !docs/**/reference/**
  • docs/reference/type-aliases/HotkeyOptionsFor.md is excluded by !docs/**/reference/**
  • docs/reference/type-aliases/HotkeyRegistration.md is excluded by !docs/**/reference/**
  • docs/reference/type-aliases/HotkeyRegistrationStatus.md is excluded by !docs/**/reference/**
  • docs/reference/type-aliases/HotkeyRegistrationView.md is excluded by !docs/**/reference/**
Files selected for processing: 40

  • .changeset/auto-ignore-inputs-non-typing-keys.md
  • .intent/review-state.json
  • docs/framework/alpine/guides/hotkeys.md
  • docs/framework/alpine/guides/sequences.md
  • docs/framework/alpine/quick-start.md
  • docs/framework/angular/guides/hotkeys.md
  • docs/framework/angular/guides/sequences.md
  • docs/framework/angular/quick-start.md
  • docs/framework/ember/guides/hotkeys.md
  • docs/framework/ember/guides/sequences.md
  • docs/framework/ember/quick-start.md
  • docs/framework/lit/guides/hotkeys.md
  • docs/framework/lit/guides/sequences.md
  • docs/framework/lit/quick-start.md
  • docs/framework/octane/guides/hotkeys.md
  • docs/framework/octane/guides/sequences.md
  • docs/framework/octane/quick-start.md
  • docs/framework/preact/guides/hotkeys.md
  • docs/framework/preact/guides/sequences.md
  • docs/framework/preact/quick-start.md
  • docs/framework/react/guides/hotkeys.md
  • docs/framework/react/guides/sequences.md
  • docs/framework/react/quick-start.md
  • docs/framework/solid/guides/hotkeys.md
  • docs/framework/solid/guides/sequences.md
  • docs/framework/solid/quick-start.md
  • docs/framework/svelte/guides/hotkeys.md
  • docs/framework/svelte/guides/sequences.md
  • docs/framework/svelte/quick-start.md
  • docs/framework/vue/guides/hotkeys.md
  • docs/framework/vue/guides/sequences.md
  • docs/framework/vue/quick-start.md
  • docs/guides/sensible-defaults.md
  • e2e/browser/focus.spec.ts
  • packages/hotkeys/skills/hotkeys-core/SKILL.md
  • packages/hotkeys/src/_registration.ts
  • packages/hotkeys/src/hotkey-manager.ts
  • packages/hotkeys/tests/aria-widgets.test.ts
  • packages/hotkeys/tests/hotkey-manager.test.ts
  • packages/hotkeys/tests/registration-and-target.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

1 package(s) bumped directly, 17 bumped as dependents.

🟨 Minor bumps

Package Version Reason
@tanstack/hotkeys 0.33.1 → 0.34.0 Changeset

🟩 Patch bumps

Package Version Reason
@tanstack/alpine-hotkeys 0.15.3 → 0.15.4 Dependent
@tanstack/angular-hotkeys 0.25.3 → 0.25.4 Dependent
@tanstack/angular-hotkeys-devtools 0.5.15 → 0.5.16 Dependent
@tanstack/ember-hotkeys 0.14.3 → 0.14.4 Dependent
@tanstack/hotkeys-devtools 1.12.0 → 1.12.1 Dependent
@tanstack/lit-hotkeys 0.27.3 → 0.27.4 Dependent
@tanstack/octane-hotkeys 0.15.3 → 0.15.4 Dependent
@tanstack/preact-hotkeys 0.24.3 → 0.24.4 Dependent
@tanstack/preact-hotkeys-devtools 0.13.15 → 0.13.16 Dependent
@tanstack/react-hotkeys 0.27.2 → 0.27.3 Dependent
@tanstack/react-hotkeys-devtools 0.14.15 → 0.14.16 Dependent
@tanstack/solid-hotkeys 0.26.0 → 0.26.1 Dependent
@tanstack/solid-hotkeys-devtools 0.14.0 → 0.14.1 Dependent
@tanstack/svelte-hotkeys 0.25.3 → 0.25.4 Dependent
@tanstack/svelte-hotkeys-devtools 0.5.15 → 0.5.16 Dependent
@tanstack/vue-hotkeys 0.25.3 → 0.25.4 Dependent
@tanstack/vue-hotkeys-devtools 0.13.15 → 0.13.16 Dependent

@pkg-pr-new

pkg-pr-new Bot commented Nov 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@tanstack/alpine-hotkeys

npm i https://pkg.pr.new/@tanstack/alpine-hotkeys@299

@tanstack/angular-hotkeys

npm i https://pkg.pr.new/@tanstack/angular-hotkeys@299

@tanstack/angular-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/angular-hotkeys-devtools@299

@tanstack/ember-hotkeys

npm i https://pkg.pr.new/@tanstack/ember-hotkeys@299

@tanstack/hotkeys

npm i https://pkg.pr.new/@tanstack/hotkeys@299

@tanstack/hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/hotkeys-devtools@299

@tanstack/lit-hotkeys

npm i https://pkg.pr.new/@tanstack/lit-hotkeys@299

@tanstack/octane-hotkeys

npm i https://pkg.pr.new/@tanstack/octane-hotkeys@299

@tanstack/preact-hotkeys

npm i https://pkg.pr.new/@tanstack/preact-hotkeys@299

@tanstack/preact-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/preact-hotkeys-devtools@299

@tanstack/react-hotkeys

npm i https://pkg.pr.new/@tanstack/react-hotkeys@299

@tanstack/react-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/react-hotkeys-devtools@299

@tanstack/solid-hotkeys

npm i https://pkg.pr.new/@tanstack/solid-hotkeys@299

@tanstack/solid-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/solid-hotkeys-devtools@299

@tanstack/svelte-hotkeys

npm i https://pkg.pr.new/@tanstack/svelte-hotkeys@299

@tanstack/svelte-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/svelte-hotkeys-devtools@299

@tanstack/vue-hotkeys

npm i https://pkg.pr.new/@tanstack/vue-hotkeys@299

@tanstack/vue-hotkeys-devtools

npm i https://pkg.pr.new/@tanstack/vue-hotkeys-devtools@299

commit: 637a2d0

@KevinVandy
KevinVandy marked this pull request as ready for review November 25, 2026 16:59
@KevinVandy
KevinVandy merged commit 980d86f into main Nov 25, 2026
16 checks passed
@KevinVandy
KevinVandy deleted the feat/auto-ignore-inputs-non-typing-keys branch November 25, 2026 17:57
@github-actions github-actions Bot mentioned this pull request Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR has been released!

Thank you for your contribution!

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.

1 participant