[X] I have verified that I use latest version of all @mantine/* packages
What version of @mantine/* packages do you have in package.json?
7.12.2
What package has an issue?
@mantine/hooks
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
All
Describe the bug
The useHotkeys hook does not listen to the " " spacebar key. It seems that during the key parsing, we trim spaces causing the resulting space key to be no key. The Spacebar key code was used in older browsers but now they seem to all use the " " key code
If possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
An easy fix would be to add an option in the HotkeyItemOptions to prevent trimming while parsing the key. This way we'd maintain backward compatibility and the space key would work.
Self-service
[ ] I would be willing to implement a fix for this issue
Dependencies check up
What version of @mantine/* packages do you have in package.json?
7.12.2
What package has an issue?
@mantine/hooks
What framework do you use?
Next.js
In which browsers you can reproduce the issue?
All
Describe the bug
The useHotkeys hook does not listen to the
" "
spacebar key. It seems that during the key parsing, we trim spaces causing the resulting space key to be no key. TheSpacebar
key code was used in older browsers but now they seem to all use the" "
key codeIf possible, include a link to a codesandbox with a minimal reproduction
No response
Possible fix
An easy fix would be to add an option in the
HotkeyItemOptions
to prevent trimming while parsing the key. This way we'd maintain backward compatibility and the space key would work.Self-service