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

Count in the Knobs tab is "behind by one" when clicking through stories #21

Open
kaiyoma opened this issue Dec 11, 2020 · 4 comments
Open

Comments

@kaiyoma
Copy link

kaiyoma commented Dec 11, 2020

Describe the bug
When clicking through stories, the count (of knobs) in the Knobs tab is wrong. More specifically, it's always "behind by one", meaning that it's showing the count from the previous story that was selected.

To Reproduce
Steps to reproduce the behavior:

  1. Have multiple stories with differing counts of knobs
  2. Click through the stories

Expected behavior
The knob count should be correct.

System

Environment Info:

  System:
    OS: Windows 10 10.0.19042
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 14.15.0 - C:\Program Files\Node.js\node.EXE
    Yarn: 1.22.5 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 6.14.8 - C:\Program Files\Node.js\npm.CMD
  Browsers:
    Chrome: 87.0.4280.88
    Edge: Spartan (44.19041.423.0), Chromium (87.0.664.55)
@shilman
Copy link
Member

shilman commented Dec 11, 2020

FYI, we’ve released addon-controls in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term.

Please upgrade and try them out today!

@kaiyoma
Copy link
Author

kaiyoma commented Dec 14, 2020

@shilman I tried out addon-controls today and TBH I don't really like it. They make the story code really verbose and stretched out, and now the args definitions are far removed from the place where the component is being rendered. It's also kind of awkward to have to suppress props from appearing (opt-out) rather than purposefully adding knobs (opt-in). Default values for the controls are also awkward; in fact, I can't figure out how to do it, even after reading all the docs.

I think I'll be sticking with knobs since the resulting story code is much easier to read, understand, and maintain.

@shilman
Copy link
Member

shilman commented Dec 15, 2020

@kaiyoma we're aiming to deprecate knobs in 6.2 and remove them in 7.0

@kaiyoma
Copy link
Author

kaiyoma commented Dec 15, 2020

I think that's really unfortunate because the knobs API is far superior to controls, at least right now. I would actually consider staying on Storybook 6 indefinitely to avoid moving to controls.

@shilman shilman transferred this issue from storybookjs/storybook May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants