-
Notifications
You must be signed in to change notification settings - Fork 18
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
Reopen of 9472: Addons / Knobs - When type is Number using the number knob, throws an error on delete and field is null #6
Comments
FYI, we’ve released Please upgrade and try them out today! |
I just reached for knobs since that what I was familiar with from previous Storybook work. Sounds like this is a low priority bug then. I will experiment with migrating to controls. Thank you! |
@kmurgic yup, planning to deprecate knobs in 6.2. please give controls a try! |
@shilman this also happens in controls, btw 😉 |
@laddi-netapp not too surprising since controls is based on the knobs code. the difference is that it's much more likely to get fixed in controls 😉 |
Just confirmed that I am getting the same issue in controls, when I delete the content of a number input.
|
I can open a PR for this. I figured out a way to change the storybook code to fix it, but I'm not sure if it's the best/cleanest possible way. |
I haven't really contributed to open source before, so apologies in advance if my PR and/or ability to follow the contributing process is lacking. |
storybookjs/storybook#14457 should fix the issue. |
Quoting from storybookjs/storybook#9472 (closed as stale). I am still experiencing this issue, so I am reopening.
Expected behavior
There is no error when the text in a number input is deleted. I believe the value of the input is being set to null when it should be set to an empty string instead. The value of the knob could be null, but the value of the input element should be an empty string.
Additonal Small Requested Change
In TypeScript the value of a
number
knob is typed as number, leaving no way to initialize the number input as empty. It would be nice to allow an option to initialize the value of the knob as null .System
Additional context
It looks like this issue has been brought up a few times, and possibly fixed.
storybookjs/storybook#9472 (closed as stale)
storybookjs/storybook#8882 (closed as stale)
storybookjs/storybook#5912 (closed as fixed)
storybookjs/storybook#2475 (closed as fixed)
The text was updated successfully, but these errors were encountered: