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

Knob "select" does not work on nested story #6703

Closed
oluckyman opened this issue May 1, 2019 · 2 comments
Closed

Knob "select" does not work on nested story #6703

oluckyman opened this issue May 1, 2019 · 2 comments

Comments

@oluckyman
Copy link

Describe the bug
When I use select knob in a nested story:

storiesOf('Chart / series', module)
  .add('nested story', ...)

it throws an error in the console
image
if I go to root story first, reload the page and then go to the nested story. It does not throw the error, but the select knob does not work: when I change the selection, it does not update the component and returns the selection to the initial value in a half of a second or so.

To Reproduce
on Vue project:

storiesOf('Chart', module)
  .add('root story with select works', ...)
storiesOf('Chart / series', module)
  .add('nested story with select does not work', ...)

Expected behavior
Should work both on root and nested stories and do not throw emit error in the console

Screenshots
this._channel is undefined
image

System:

  • OS: MacOs
  • Device: Macbook Pro
  • Browser: chrome
  • Framework: vue
  • Addons: knobs
  • Version:
    "@storybook/addon-knobs": "^5.0.11",
    "@storybook/vue": "^5.0.11
@shilman
Copy link
Member

shilman commented May 1, 2019

I'm not sure that's valid nesting. Does it work if you try storiesOf('Chart/standard', ...).add(...) and storiesOf('Chart/series', ...).add(...)?

@oluckyman
Copy link
Author

Just tried this:

storiesOf('Chart / standard', ...).add('knob', ...)
storiesOf('Chart / series', ...).add('knob', ...)

It works for 'standard' section and does not work for 'series'.


And just before sending this comment I realized that the first section has addDecorator and all the rest don't 🤦‍♂️

storiesOf('Chart / standard', ...)
  .addDecorator(withKnobs)

Sorry! with addDecorator directive it all works as expected.

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