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

Search keyboard shortcut doesn't work with non-US keyboard layout #13296

Closed
whitezo opened this issue Nov 26, 2020 · 5 comments
Closed

Search keyboard shortcut doesn't work with non-US keyboard layout #13296

whitezo opened this issue Nov 26, 2020 · 5 comments

Comments

@whitezo
Copy link

whitezo commented Nov 26, 2020

Describe the bug
Using the Hungarian keyboard layout on a Mac results in some of the shortcuts not functioning.
"/" would be "Shift+6" but that doesn't invoke the search functionality, nor the "original" bottom right key (which is the "-" on a Hun. layout).

To Reproduce

  1. Switch to Hungarian keyboard layout
  2. Press "Shift+6" or "original" slash key

Expected behavior
Search input is highlighted

System
Mac OS Catalina / Chrome v86 (or any other browser)
Storybook v6.1.5

@shilman
Copy link
Member

shilman commented Nov 27, 2020

cc @ghengeveld

@ghengeveld
Copy link
Member

ghengeveld commented Nov 27, 2020

Could you go to https://keycode.info, press the / key on your keyboard (or whatever key you expect to focus the search), and post the data it gives here? I tried it myself by setting Hungarian QWERTY keyboard on Mac OS. This is what it gives me:

Screenshot 2020-11-27 at 12 39 09

We're using event.key === '/', which is preferable to event.keyCode because it's deprecated. It looks like we should use event.code === 'Slash' with a fallback to event.key for IE.

@ghengeveld
Copy link
Member

Do you need to press a modifier key to type a / on your keyboard? Right now we disable the keybinding when used with shift/ctrl/alt/cmd, so it'll only work when you can type / without one.

@ghengeveld
Copy link
Member

Based on this it seems you need Shift-6 to type a /. I'll update our logic to support this.

@shilman
Copy link
Member

shilman commented Nov 29, 2020

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.1.9 containing PR #13319 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants