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

Canvas tab not working properly until after reload - seems due to --docs flag. #17625

Closed
petechappell-toast opened this issue Mar 3, 2022 · 2 comments

Comments

@petechappell-toast
Copy link

Describe the bug

When the --docs flag is added to either start-storybook or build-storybook it results in the following:

  • toolbar hidden by default
  • switching to canvas tab doesn't work (unless you refresh)
  • actions panel not showing on canvas tab by default
  • when navigating to subsequent stories, the canvas tab is shown as active but the user still see "docs" mode
Screen.Recording.2022-03-03.at.17.30.24.mov

To Reproduce
Please create a reproduction by running n and following the instructions. Read our documentation to learn more about creating reproductions.
Paste your repository and deployed reproduction here. We prioritize issues with reproductions over those without.

I'm not going to push up a public repo for this because it is so easy to reproduce (with minimal changes)

  • run npx sb@next repro
  • follow the prompts as per usual
  • update the package.json file to add the --docs flag
    "storybook": "start-storybook -p 6006 --docs"
    
  • run yarn storybook

System

Environment Info:

  System:
    OS: macOS 12.2.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Binaries:
    Node: 12.18.4 - ~/.volta/tools/image/node/12.18.4/bin/node
    Yarn: 3.2.0 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
    npm: 6.14.6 - ~/.volta/tools/image/node/12.18.4/bin/npm
  Browsers:
    Chrome: 98.0.4758.109
    Firefox: 96.0.2
    Safari: 15.3
  npmPackages:
    @storybook/addon-actions: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/addon-docs: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/addon-essentials: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/addon-interactions: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/addon-links: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/react: ^6.5.0-alpha.45 => 6.5.0-alpha.45 
    @storybook/testing-library: ^0.0.9 => 0.0.9 

Additional context

I wonder if this might be related to (or the cause of) other similar issues... For example: #15283

From the SB docs, it looks like the --docs flag should only set the initial view to "docs". But it seems to be doing more than that.

@petechappell-toast
Copy link
Author

If you're experiencing this kind of problem switching between the canvas and doc tabs, a short-term fix is to disable the --docs flag from your build.

@shilman
Copy link
Member

shilman commented Jun 8, 2023

We’re cleaning house! Storybook has changed a lot since this issue was created and we don’t know if it’s still valid. Please open a new issue referencing this one if:

@shilman shilman closed this as not planned Won't fix, can't repro, duplicate, stale Jun 8, 2023
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

2 participants