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
Controls: boolean control throws a red warning #10967
Comments
Do you have a public repro for this, or can you add one to |
@shilman wooops, |
@matheo hmmm did you try recently? might have gotten fixed since you filed this through some other change, since i've been messing with this code a bunch |
yeah, I just compared the code of I will dig a little bit in the argTypes of the controls that are failing to see if there's something missing there. |
Thanks! It wouldn't surprise me if there was still a bug, just having trouble repro-ing it! 😄 |
@matheo I found a repro case in |
I checked some stories of |
Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks! |
ZOMG!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.21 containing PR #12322 that references this issue. Upgrade today to try it out! Closing this issue. Please re-open if you think there's still more to do. |
I updated to v6.0.21 and this is still happening for me. |
@gregfagan Do you have a repro repo you can share? |
Sorry, not at the moment; this is in a private repo |
Actually this might have been a stale cache or some other problem. It is no longer throwing errors for my. My mistake. |
@monolithed does it fix it to add:
|
@shilman, I have already tried it before. it can be reproduced with the simplest component: const Input = ({...props}) => (<Input {...props} />);
...
value: {
description: 'Input',
defaultValue: 0,
table: {
type: {
summary: 'number'
},
},
control: {
type: 'number'
}
}
... |
I get this error on 6.1.18, but manually setting |
@kevinzang can you try in 6.2-beta? we recently fixed a bunch of bugs around default value handling |
@shilman with 6.2.0-beta.3 I can still reproduce this error in two ways:
Sample codefoo.js
foo.stories.js
Sample codeChange the Foo component from the above sample code to
|
I can reproduce this using v6.2.5 with |
I can reproduce this too using v6.2.9 with
Screenshot: Initially, Storybook rendered a blank numeric input field control and the console was empty. However, when I typed |
Adding a default value for the option fixes it for me: export default {
component: SomeComponent,
title: "Components/SomeComponent",
argTypes: {
myNumber: {
control: {
type: "range",
min: 2,
max: 7,
},
}
},
// This next blob is the fix!
args: {
myNumber: 5,
},
}; |
Describe the bug
Playing with
"@storybook/addon-controls": "6.0.0-beta.17"
I got this warning after clicking a boolean control, which is theinverseColors
input (at the beggining of the screenshot):Upcoming clicks in the checkbox doesn't throw this,
as it seems that the checkbox is already changed to controlled.
System:
The text was updated successfully, but these errors were encountered: