Skip to content

Comments

feat: sequence-manager feature parody with hotkey-manager#21

Merged
KevinVandy merged 10 commits intoTanStack:mainfrom
kadeangell:feat-ignore-inputs-in-hotkey-sequences
Feb 21, 2026
Merged

feat: sequence-manager feature parody with hotkey-manager#21
KevinVandy merged 10 commits intoTanStack:mainfrom
kadeangell:feat-ignore-inputs-in-hotkey-sequences

Conversation

@kadeangell
Copy link
Contributor

@kadeangell kadeangell commented Feb 17, 2026

🎯 Changes

Added support for the ignoreInputs flag on the hotkey sequences by adding an #isInputElement method to the SequenceManager class.

fixes #34

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

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

SequenceManager never checked the ignoreInputs option, so keyboard sequences like G+A and G+G would fire even when the user was typing in input, textarea, select, or contentEditable elements.
Two issues were fixed:

1. SequenceManager (#handleKeyDown) now checks ignoreInputs before matching keys. A new #isInputElement() method mirrors the same logic from HotkeyManager. The ignoreInputs default is resolved at registration time using the first step of the sequence — Ctrl/Meta combos and Escape default to false (fire in inputs), while single keys and Shift/Alt combos default to true (ignored in inputs).

2. useHotkeySequence React hook was silently dropping the ignoreInputs option — it only forwarded timeout and platform to manager.register().  Now ignoreInputs is extracted, forwarded, and included in the effect dependency array.

Added tests covering: single-key sequences ignored in input/textarea/ contentEditable by default, Mod sequences firing in inputs by default, explicit ignoreInputs: true/false overrides, and button-type inputs not being treated as text inputs.
@kadeangell kadeangell changed the title Feat ignore inputs in hotkey sequences fix: add ignoreInputs support to SequenceManager and useHotkeySequence Feb 17, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 18, 2026

Open in StackBlitz

@tanstack/hotkeys

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

@tanstack/hotkeys-devtools

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

@tanstack/react-hotkeys

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

@tanstack/react-hotkeys-devtools

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

@tanstack/solid-hotkeys

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

@tanstack/solid-hotkeys-devtools

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

commit: 430c4f4

@kentcdodds
Copy link
Member

Confirming this is an issue.

@KevinVandy
Copy link
Member

Before shipping this, I'm exploring sharing more code/functionality between the hotkey-manager and sequence-manager

@KevinVandy
Copy link
Member

ok, this is now a large overhaul of the sequence-manager to now be just as good as the hotkey-manager

@KevinVandy KevinVandy changed the title fix: add ignoreInputs support to SequenceManager and useHotkeySequence feat: sequence-manager feature parody with hotkey-manager Feb 21, 2026
@KevinVandy KevinVandy merged commit 7328e36 into TanStack:main Feb 21, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Feb 21, 2026
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.

SequenceManager ignores ignoreInputs (sequences fire while typing in inputs)

3 participants