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

Background Addon does not seem to trigger AddonsAPI #6873

Closed
khrome83 opened this issue May 23, 2019 · 6 comments
Closed

Background Addon does not seem to trigger AddonsAPI #6873

khrome83 opened this issue May 23, 2019 · 6 comments

Comments

@khrome83
Copy link

Describe the bug
I can't get the example code for Background addond to trigger any console.log -

addonAPI.getChannel().on('storybook/background/update', (bg) => {
  console.log('Background color', bg.selected);
  console.log('Background name', bg.name);
});

To Reproduce
Steps to reproduce the behavior:

  1. Setup Background Addon
  2. Past Example Code with addonAPI import into ./storybook/config.js

Expected behavior
Should see the example console.log behavior.

System:

  • OS: MacOS
  • Device: Macbook Pro 2017
  • Browser: chrome
  • Framework: vue
  • Addons: backgrounds
  • Version: 5.0.11

Additional context
Question - My goal was to identify when the background swapped, and append a class to the root within the iFrame. Is there a better way to do this? I need to identify when the background theme was changed so the class can mimic changing a top level section to "inverse" or "dark".

Thanks!

@shilman
Copy link
Member

shilman commented Jun 10, 2019

@khrome83 You can enable verbose logging in chrome dev tools and see every message that gets sent on the channel. Does that help?

@khrome83
Copy link
Author

@shilman - i abandoned this and took a different approach. I added a decarator that renders multiple instances of the content, each with a different background color, and applying a different parent class, so the content could respond.

Thank you though.

@iamgbayer
Copy link

@shilman I'm having this problem to see trigged consoles same with verbose enabled

@shilman
Copy link
Member

shilman commented Jun 27, 2019

@iamgbayer you don't see any console messages from the channel? or don't see this specific message?

@stale
Copy link

stale bot commented Jul 18, 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 Jul 18, 2019
@stale
Copy link

stale bot commented Aug 17, 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 Aug 17, 2019
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