NumpadAdd does not match plus-key hotkeys
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 719
- Forks
- 47
- Avg merge
- 5d 5h
- Merged PRs (30d)
- 1
Description
TanStack Hotkeys version
v0.10.0
Framework/Library version
v19.2.5
Describe the bug and the steps to reproduce it
When registering a plus-key hotkey, the shortcut works for the main keyboard plus/equals key path, but does not reliably match the numpad plus key (KeyboardEvent.code === "NumpadAdd").
This makes it difficult to support common app shortcuts such as zoom in with Mod + +, where users may reasonably press either the main + key or the numpad + key.
Steps to reproduce:
- Register a React hotkey for a plus shortcut, for example
{ key: "+", mod: true}. - Focus the page.
- Press
Ctrl + NumpadAddon Windows/Linux, orMeta + NumpadAddon macOS. - Observe that the hotkey callback is not invoked.
- Add a native
keydownlistener and inspect the event; the browser emitsevent.code === "NumpadAdd"andevent.key === "+".
Expected behavior:
A plus-key hotkey should match numpad plus as well, or the docs should describe the recommended way to register numpad plus separately.
Actual behavior:
The app needs a separate raw keydown escape hatch for NumpadAdd.
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://codesandbox.io/p/sandbox/condescending-wing-tx6zm7
Screenshots or Videos (Optional)
N/A
Do you intend to try to help solve this bug with your own PR?
None
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked CodeSandbox and compare the registered plus shortcut with native keydown events for the main plus key and NumpadAdd. Trace the hotkey matching path used by the React registration and verify completion when Ctrl or Meta plus NumpadAdd invokes the callback without requiring a raw keydown escape hatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100