Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v5] Hotkeys using alt no longer work as expected #6257

Closed
jrafidi opened this issue Jun 29, 2023 · 1 comment · Fixed by #6301
Closed

[v5] Hotkeys using alt no longer work as expected #6257

jrafidi opened this issue Jun 29, 2023 · 1 comment · Fixed by #6301

Comments

@jrafidi
Copy link
Contributor

jrafidi commented Jun 29, 2023

Environment

  • Package version(s): 5.0.0-beta.2
  • Operating System: OSX
  • Browser name and version: Chrome 114.0.5735.133

Code Sandbox

https://stackblitz.com/edit/vitejs-vite-vsbugp?file=src%2FCoreExample.tsx

Steps to reproduce

  1. Make a hotkey like this:
      {
        label: "test",
        global: true,
        combo: "alt+a",
        onKeyDown: () => {
          alert("here");
        }
      }
  1. Attempt to trigger it with alt+a

Actual behavior

Nothing happens.

Expected behavior

Alert appears.

Possible solution

This line swapped the key combo parsing to use event.key instead of event.which: https://github.com/palantir/blueprint/pull/6106/files#diff-fec59d61737971c807d9d0b765c8d0c3ba1d1f1880cdd4b3a652ab0789d016dbR169

The key in the case of alt+a is å, and I suspect is also variable depending on keyboard settings. Probably shouldn't depend on key for parsing key combos?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants