Global layout parameter isn't applied to DocsPage canvas
See original GitHub issueDescribe the bug
When I add a global layout parameter (e.g. layout: 'fullscreen'
) in preview.js
it gets applied to the Canvas tab of all stories. However, it does not get applied to the stories / Canvas element on my MDX DocsPage. I would still need to set this manually for it to work:
<Canvas>
<Story name="storyname" parameters={{ layout: 'fullscreen' }}>
To Reproduce
Add a global layout parameter to .storybook/preview.js
and check out a docs page with a story wrapped in a canvas.
Expected behavior
I expected the docs page story to apply the same global parameters and not need to manually add the parameters to every story.
System:
Environment Info:
System: OS: macOS 10.15.5 CPU: (4) x64 Intel® Core™ i5-6267U CPU @ 2.90GHz Binaries: Node: 14.8.0 - /usr/local/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.7 - /usr/local/bin/npm Browsers: Chrome: 84.0.4147.125 Firefox: 75.0 Safari: 13.1.1 npmPackages: @storybook/addon-controls: ^6.0.13 => 6.0.13 @storybook/addon-docs: ^6.0.13 => 6.0.13 @storybook/react: ^6.0.13 => 6.0.13
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:9 (3 by maintainers)
@tgelu In the original issue description @robbertkl mentioned that it works if he adds a layout parameter to the
Story
block, so I addedhas workaround
label. I did not verify the behavior. Though re-reading the issue I doubt that actually works. Removing the label, but please let me know if you find a workaround!This seems to be tagged as “has workaround”. What is the workaround @shilman ? 😃