-
Notifications
You must be signed in to change notification settings - Fork 149
Description
Describe the bug
According to the documentation, useHotkeys
' callback should have a property called hotkey
(see "Also you could work directly with hotkey trigger:"), but it disappeared with v5. This is working fine in v4.
hotkey
property is very useful to distinguish between eg. shift+a
and ctrl+a
if there are lots of combinations in one callback (I'm using it for context menu with many, dynamic entries)
To Reproduce
Steps to reproduce the behavior:
- Create a (TypeScript) project
- Call:
useHotkeys(["ctrl+a", "shift+a"], (e, handler) => console.log(handler.hotkey));
Stackblitz: https://stackblitz.com/edit/vitejs-vite-qhkqevmj?file=src%2FApp.tsx
Actual behavior
undefined
is logged
Expected behavior
Either ctrl+a
or shift+a
should be logged
Desktop (please complete the following information):
- Version: v5.1.0
Additional context
hotkey
disappeared from parseHotkey
between v4.6.2...v5.0.0