JohannesKlauss / react-hotkeys-hook

React hook for using keyboard shortcuts in components.
https://react-hotkeys-hook.vercel.app/
MIT License
2.68k stars 114 forks source link

[BUG] preventDefault seems not work when use `command + s ` #1154

Closed LeeeeeeM closed 6 months ago

LeeeeeeM commented 6 months ago

Describe the bug preventDefault seems not work when use command + s

To Reproduce Steps to reproduce the behavior: Just click command + s, it does't work in ^4.5.1 with react v18+, but it works well in 1.5.3 with react v16.8.

Please try and add a codesandbox or stackblitz to reproduce the bug: https://stackblitz.com/edit/react-bn1xfi?file=src%2FApp.js

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

LeeeeeeM commented 6 months ago

Maybe command should convert to meta

JohannesKlauss commented 6 months ago

command is not a valid key. Use meta instead.