-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Control boolean with default value in component is not initialized correctly (vue js component) #14149
Comments
Not sure but it is very similar to #14147 |
Try upgrading to the latest prerelease:
Does that fix it? |
Nope. Did i miss something in my code ? |
I have the same issue with an Angular library project. This is happening with the current latest version as well as the prerelease version, installed via Here's my button:
Here's my Storybook story for it:
But still, when I open the "Disabled" state button story, the control has the state toggled on, but it's not reflected in the UI with the button item: If I use the control to toggle the Curiously the |
Does anybody have a reproduction they can share? See how to create a repro. We prioritize issues with reproductions over those without. Thank you! 🙏 |
With my colleague we worked on this issue few days ago. Because we were living since 5 march with this probleme. In our case, we try to set some attribute to This work pretty well. In our case (the top first exemple of this page), the props is So i don't know if it is a storybook probleme or an implementation probleme. If it could help, enjoy :) |
We fixed this by using |
@Hypenate - more details on your solution, please? I'm having what I think is a similar issue. I have a button which I'd like to be able to see both the enabled and disabled states in one story. If I set args it works, but using the toggle in the controls panel doesn't seem to have the desired effect. If I log the value of the variable (in my actual Button component) then I see undefined which leads me to believe I'm missing a step in configuring my story, but I've gone through the docs a few times to no avail. Editing to clarify: I can set the property to either true or false with args but the switch doesn't work in the control panel. No matter what I toggle that to, the component always has the value that was set in args. |
Hi there! Thank you for opening this issue, but it has been marked as |
I'm afraid we need to close this issue for now, since we can't take any action without the requested reproduction or additional information. But please don't hesitate to open a new issue if the problem persists – we're always happy to help. Thanks so much for your understanding. |
For anyone else looking for this info: const meta = {
component: Example,
argTypes: {
value: {
// ❌ Deprecated
defaultValue: 0,
},
},
// ✅ Do this instead
args: {
value: 0,
},
} satisfies Meta<typeof Example>; src: https://storybook.js.org/docs/7.0/react/api/arg-types#defaultvalue |
Describe the bug
props in vue js component with default value to
true
and a story which have the props set tofalse
in the template not init correctly the component in storybook.To Reproduce
Steps to reproduce the behavior:
I do a component using vue js. This component have a props
isPrimary
with default value set totrue
. In the template of the story is set this props tofalse
.Additional info
If you set to
false
as default in the component and set totrue
the template in the story, the storybook behavior is correct.We see the control set to
true
and the component displaytrue
.Expected behavior
I expected to see the control set to
false
. And my component receive a props withfalse
Screenshots
After toggling
true/false
storybook behavior is as expected.Code snippets
The vue component:
The story:
System
The text was updated successfully, but these errors were encountered: