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

Style loader data remains in iframe when changing stories #4945

Closed
ozzyogkush opened this issue Dec 6, 2018 · 8 comments
Closed

Style loader data remains in iframe when changing stories #4945

ozzyogkush opened this issue Dec 6, 2018 · 8 comments

Comments

@ozzyogkush
Copy link

Describe the bug
When switching between viewing stories, the <style> tags from previous style-loader outputs remain in the preview iframe.

To Reproduce
Steps to reproduce the behavior:

  1. Make a story that addDecorator() that requires() a SASS/CSS file
  2. Make a separate story that does not
  3. View the first story
  4. View the second story
  5. The second story has the first story's CSS applied to it

Expected behavior
Each story preview iframe only shows loaded styles for decorators and components directly used in that story.

Code snippets

// appSassDecorator
export default story => {
    require('js-file-that-includes-sass');

    return story();
};

// story 1
const stories = storiesOf('First Set', module);
stories
  .addDecorator(appSassDecorator)
  .add('Story 1', () => <div>Should Include Styles</div>);

// story 2
const stories = storiesOf('Different Set', module);
stories
  .add('Story 2', () => <div>Should NOT Include Styles</div>);

System:

  • OS: OSX
  • Device: MBP 2018
  • Browser: Chrome
  • Framework: React
  • Addons: custom decorator
  • Version: 4.0.9
@stale
Copy link

stale bot commented Dec 29, 2018

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Dec 29, 2018
@ozzyogkush
Copy link
Author

Bump to keep active.

@stale stale bot removed the inactive label Jan 1, 2019
@stale
Copy link

stale bot commented Jan 29, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jan 29, 2019
@ozzyogkush
Copy link
Author

This is still a problem for my org... please advise!

@shilman
Copy link
Member

shilman commented Feb 20, 2019

@stale
Copy link

stale bot commented Mar 13, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Mar 13, 2019
@stale
Copy link

stale bot commented Apr 12, 2019

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

@stale stale bot closed this as completed Apr 12, 2019
@ZktSn0w
Copy link

ZktSn0w commented Dec 11, 2024

Bump to re-activate.
This issue is still a thing and the @shilman 's link is outdated.

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

3 participants