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]: Storybook addon panel visible when it should be hidden #30420

Open
psyrendust opened this issue Jan 30, 2025 · 1 comment
Open

[Bug]: Storybook addon panel visible when it should be hidden #30420

psyrendust opened this issue Jan 30, 2025 · 1 comment

Comments

@psyrendust
Copy link

psyrendust commented Jan 30, 2025

Describe the bug

When viewing a story page, if you navigate directly to the page or refresh the
story you will notice that the Addons panel below the story will be visible if
it was previously hidden. This is causing the whole page to be pushed up by
40px. The shortcuts button in the sidebar and the toolbar above the story
become inaccessible.

This seems to only be a problem when you have a more than 53 stories and you
are viewing the 54+ story and do a refresh.

I was able to confirm this behavior on Storybook version 8.4.7 and 8.5.2, on Brave, Chrome, and Safari.

The example project was created with npx storybook@latest init. I then generated a
bunch of simple stories based on a template.

Image

Reproduction link

https://github.com/psyrendust/storybook-bug

Reproduction steps

  1. Clone the example repo https://github.com/psyrendust/storybook-bug
  2. yarn install
  3. yarn storybook
  4. Navigate to example-button--primary
  5. This only happens on initial page load, so refresh the page

If you navigate to example-button--docs
and then click on Example/Button/Primary button in the sidebar you'll notice the bug is not there
anymore.

System

Storybook Environment Info:

  System:
    OS: macOS 15.2
    CPU: (16) arm64 Apple M3 Max
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.0 - ~/.nvm/versions/node/v20.13.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.0/bin/yarn <----- active
    npm: 10.9.0 - ~/.nvm/versions/node/v20.13.0/bin/npm
    pnpm: 9.0.5 - ~/.nvm/versions/node/v20.13.0/bin/pnpm
  Browsers:
    Chrome: 132.0.6834.111
    Edge: 132.0.2957.127
    Safari: 18.2
  npmPackages:
    @storybook/addon-essentials: 8.5.2 => 8.5.2
    @storybook/addon-interactions: 8.5.2 => 8.5.2
    @storybook/addon-onboarding: 8.5.2 => 8.5.2
    @storybook/addon-webpack5-compiler-swc: 2.0.0 => 2.0.0
    @storybook/blocks: 8.5.2 => 8.5.2
    @storybook/react: 8.5.2 => 8.5.2
    @storybook/react-webpack5: 8.5.2 => 8.5.2
    @storybook/test: 8.5.2 => 8.5.2
    storybook: 8.5.2 => 8.5.2

Additional context

No response

@psyrendust
Copy link
Author

I believe this has something to do with the grid-template that is applied to the div that is the first child of div#root. It doesn't seem to be respecting minmax(0px, 0px) on page load.

@media (min-width: 600px) {
  .css-1rkkere {
    display: grid;
    gap: 0px;
    grid-template:
    "sidebar content content" 1fr
"sidebar panel panel" minmax(0px, 0px) / minmax(0px, 300px) minmax(100px, 1fr) minmax(0px, 0px);
  }
}

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

1 participant