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

[Bug] JSX tab remains visible when addon is disabled #159

Open
TrevorBurnham opened this issue Aug 29, 2021 · 1 comment
Open

[Bug] JSX tab remains visible when addon is disabled #159

TrevorBurnham opened this issue Aug 29, 2021 · 1 comment
Labels

Comments

@TrevorBurnham
Copy link

Describe the bug

When this addon is disabled for a story, the "JSX" tab is still shown in the addons panel, but with blank contents.

Steps to reproduce the behavior

  1. Clone this repo: https://github.com/TrevorBurnham/storybook-addon-jsx-disable-noop
  2. Run yarn && yarn storybook
  3. Visit http://localhost:6006/?path=/story/example-button--primary
  4. Open the addons panel

Notice that the JSX tab is visible but blank because of this code:

Primary.parameters = {
  jsx: {
    disable: true,
  },
};

Expected behavior

The JSX tab should not be shown in the addons panel when the addon is disabled. This is the behavior for other addons; for example, this code hides the Actions tab for the story:

Primary.parameters = {
  actions: {
    disable: true,
  },
};

Screenshots and/or logs

When not disabled

JSX addon tab has contents

When disabled

JSX addon tab is empty

Environment

  • OS: macOS 11.5.2
  • Node.js version: 15.10.0
  • NPM version: Yarn 3.0.1
  • Browser (if applicable): Chrome
  • Browser version (if applicable): 92

Additional context

The repro project uses @storybook/[email protected]. The project where I first observed this issue was on @storybook/[email protected].

I'm not sure what the problem here is, since the way the addon uses makeDecorator (#110) looks perfectly normal to me. Maybe something about that API has changed in more recent versions of Storybook? cc @petermikitsh @hipstersmoothie

@drewbrend
Copy link

I just ran into this as well, I believe it's because paramKey is not specified here. This is what's required according to storybook docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants