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 + NumpadAdd on Windows/Linux, or Meta + NumpadAdd on macOS.
- Observe that the hotkey callback is not invoked.
- Add a native
keydown listener and inspect the event; the browser emits event.code === "NumpadAdd" and event.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
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:
{ key: "+", mod: true}.Ctrl + NumpadAddon Windows/Linux, orMeta + NumpadAddon macOS.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
keydownescape hatch forNumpadAdd.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