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

fix: controls missing when navigating from story #21967

Merged

Conversation

LeniWen
Copy link
Contributor

@LeniWen LeniWen commented Apr 6, 2023

Closes #21805

What I did

If a story has disabled the controls add-on and navigate to another story that hasn't disabled it, the add-on may still appear

Please note that this PR cause the components in the Secondary story to flicker(Controls - Actions - Interactions -> Actions - Interactions). I am not sure if this change is correct, so please let me know if there are any issues

How to test

  1. Run a sandbox for template, e.g. yarn task --task sandbox --start-from auto --template react-vite/default-ts
  2. Please update the value of Secondary in the file sandbox/react-vite-default-ts/src/stories/Button.stories.ts with the follow code
export const Secondary: Story = {
  args: {
    label: 'Button',
  },
  parameters: {
    controls: {
      disable: true
    }
  }
};
  1. Open Storybook in your browser
  2. Access Secondary story, the controls add-on is disabled
  3. Access Primary story, the controls add-on appear

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@kylegach kylegach added bug ui patch:yes Bugfix & documentation PR that need to be picked to main branch labels Apr 10, 2023
@valentinpalkovic valentinpalkovic added bug and removed bug labels Apr 18, 2023
@nate-summercook
Copy link

Encountered this bug too. Would be glad for a fix :)

@valentinpalkovic valentinpalkovic merged commit 6d1efd6 into storybookjs:next Apr 25, 2023
49 checks passed
@valentinpalkovic
Copy link
Contributor

@liwn9527 LGTM! Thank you very much for your contribution.

@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label May 3, 2023
shilman pushed a commit that referenced this pull request May 3, 2023
fix: controls missing when navigating from story
@LeniWen LeniWen deleted the its9527/fix-control-missing branch May 11, 2023 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Storybook 7 - controls missing when navigating from controls: disabled story
5 participants