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

[Bug]: / shortcut to focus search field doesn't work #22072

Closed
filiptammergard opened this issue Apr 13, 2023 · 2 comments · Fixed by #22073
Closed

[Bug]: / shortcut to focus search field doesn't work #22072

filiptammergard opened this issue Apr 13, 2023 · 2 comments · Fixed by #22073

Comments

@filiptammergard
Copy link
Contributor

Describe the bug

When I click / (with [shift]+[7]) nothing happens, when it should focus the search field.

To Reproduce

https://stackblitz.com/github/storybookjs/sandboxes/tree/next/react-vite/default-ts/after-storybook?file=README.md

Click the preview area and then [shift]+[7]. The search field is not focused. Other keyboard shortcuts work though.

System

Environment Info:

  System:
    OS: macOS 13.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 18.13.0 - ~/.nvm/versions/node/v18.13.0/bin/node
    Yarn: 3.4.1 - /usr/local/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v18.13.0/bin/npm
  Browsers:
    Chrome: 112.0.5615.49
    Edge: 108.0.1462.46
    Firefox: 109.0
    Safari: 16.4
  npmPackages:
    @storybook/addon-a11y: 7.0.4 => 7.0.4 
    @storybook/addon-actions: 7.0.4 => 7.0.4 
    @storybook/addon-coverage: 0.0.8 => 0.0.8 
    @storybook/addon-essentials: 7.0.4 => 7.0.4 
    @storybook/addon-interactions: 7.0.4 => 7.0.4 
    @storybook/addon-links: 7.0.4 => 7.0.4 
    @storybook/addon-styling: 1.0.0 => 1.0.0 
    @storybook/addons: 7.0.4 => 7.0.4 
    @storybook/jest: 0.1.0 => 0.1.0 
    @storybook/node-logger: 7.0.4 => 7.0.4 
    @storybook/react: 7.0.4 => 7.0.4 
    @storybook/react-vite: 7.0.4 => 7.0.4 
    @storybook/test-runner: 0.10.0 => 0.10.0 
    @storybook/testing-library: 0.1.0 => 0.1.0 
    @storybook/theming: 7.0.4 => 7.0.4

Additional context

When I click [shift]+[7], shortcut constant here is:

["shift", ["/", "7"]]

When you .join("") that you get shift/,7, which means this won't match: https://github.com/storybookjs/storybook/blob/next/code/lib/manager-api/src/lib/shortcut.ts#L83

@shilman
Copy link
Member

shilman commented Apr 25, 2023

ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.9 containing PR #22073 that references this issue. Upgrade today to the @future NPM tag to try it out!

npx sb@next upgrade --tag future

@shilman
Copy link
Member

shilman commented May 3, 2023

Yee-haw!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.8 containing PR #22073 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb@latest upgrade

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

Successfully merging a pull request may close this issue.

2 participants