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

@addon/docs: Angular numeric property with default value 0 is undefined and can't be changed #15490

Closed
stefan-schweiger opened this issue Jul 6, 2021 · 2 comments

Comments

@stefan-schweiger
Copy link
Contributor

Describe the bug
If you have a numeric input with the default value 0 @Input() value = 0 and use compodoc to generate your docs the value is set to undefined and you can't change it anymore.

image

I already have a fix for this and I'm going to make a PR right after filing this issue. It just adds this addtional check in extractTypeFromValue in the file compodoc.ts.

// current main
return defaultValue || valueType === 'boolean' || valueType === 'string' ? valueType : null;
// my PR
return defaultValue || valueType === 'number' || valueType === 'boolean' || valueType === 'string' ? valueType : null;

To Reproduce
Just add @Input() value = 0 to the doc-button in the example angular project.

@shilman
Copy link
Member

shilman commented Jul 7, 2021

Boo-yah!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.4.0-alpha.12 containing PR #15491 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb upgrade --prerelease

Closing this issue. Please re-open if you think there's still more to do.

@shilman shilman closed this as completed Jul 7, 2021
@shilman
Copy link
Member

shilman commented Jul 7, 2021

Shiver me timbers!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.3.3 containing PR #15491 that references this issue. Upgrade today to the @latest NPM tag to try it out!

npx sb upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants