-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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]: On Storybook 7, the code snippet doesn't work if one of the controls is hidden #22099
Comments
I can reproduce with your example.This is probably the root cause of your other issue #22100. This is pretty weird--taking a look now! |
@tmeasday This looks like a bug here: storybook/code/ui/blocks/src/blocks/Source.tsx Lines 83 to 99 in e154c17
Is it possible that this doesn't take conditional controls into account? You can reproduce the problem by copying @macabeus 's example into a sandbox. The JSX is getting rendered successfully, but somehow this function is returning the empty string, which is causing other code to fallback to using the original story source in another part of the code. |
@shilman I'll admit I don't know how the conditional args work -- where in the chain does the |
@tmeasday Found a similar issue. Your PR might already fix it but, adding my example here. I'm using the angular (latest) sandbox. The default button stories that come in the sandbox. "Show code" works fine both on first load and when I interact with the However, if I add mapping to that control. Like so:
Show code works fine on first load, but breaks once I select the control |
Thanks @winkerVSbecks. Mapping + conditional control filtering happen in the same place so this is indeed the same issue. |
Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.1.0-alpha.12 containing PR #22135 that references this issue. Upgrade today to the
|
Jiminy cricket!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.12 containing PR #22135 that references this issue. Upgrade today to the
|
Describe the bug
I have a React component whose story has conditional controls, but I noticed that it doesn't outputs correctly the JSX if one of the controls is hidden.
The same code works on Storybook 6.
May be related to #22100
To Reproduce
System
Additional context
No response
The text was updated successfully, but these errors were encountered: