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

DocsPage controls do not work for iframe stories #145

Open
stephiescastle opened this issue Feb 7, 2022 · 1 comment
Open

DocsPage controls do not work for iframe stories #145

stephiescastle opened this issue Feb 7, 2022 · 1 comment
Labels
bug Something isn't working documentation Improvements or additions to documentation storybook This issue relates to Storybook.js

Comments

@stephiescastle
Copy link
Member

stephiescastle commented Feb 7, 2022

Issue description

On stories whose DocsPage is configured to use iframes instead of inline stories (inlineStories: false), editing the controls or "ArgsTable" properties doesn't update the rendered story.

  • This only occurs on Docs that set inlineStories: false
  • This only occurs in the Docs view. Canvas view works fine

inlineStories: false was used to fix init issues with components that require additional JavaScript functionality that was not initializing correctly. Specifically, this is required for any Swiper.js carousel and the HeroMedia component (Javascript is used for the mobile caption toggle).

Steps to reproduce the issue

  1. Go to the docs view of any story that has inlineStories: false. Ex: https://nasa-jpl.github.io/explorer-1/?path=/docs/components-blocks-blockarticlecarousel--carousel
  2. Try editing any value in the docs table. Ex: try editing the "Heading" for BlockArticleCarousel
  3. You will see that the embedded story does not update to reflect the change.
  4. Try the same thing in Canvas view.
  5. You will see that the rendered story does update in canvas view

What's the expected result?

That the rendered story on the DocsPage will update to match changed values in the ArgsTable

What's the actual result?

The rendered story on the DocsPage does not update.

Additional details

Possible approaches, in order of effort:

  1. Add a note to the Docs view either introducing or possibly replacing the ArgsTable directing users to view the story in Canvas mode to modify the arguments.
  2. Fix inlineStories in Docs view to initialize correctly, perhaps by using the prepareForInline function. Additionally, these problematic components seem to initialize correctly in our MDX docs, so we could try switching to MDX as well.
@stephiescastle stephiescastle added bug Something isn't working storybook This issue relates to Storybook.js documentation Improvements or additions to documentation labels Feb 7, 2022
@stephiescastle
Copy link
Member Author

This is a known issue:
storybookjs/storybook#11908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation storybook This issue relates to Storybook.js
Projects
None yet
Development

No branches or pull requests

1 participant