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

ArgType defaultValue: 0 returns undefined #12767

Closed
kiastorm opened this issue Oct 14, 2020 · 3 comments
Closed

ArgType defaultValue: 0 returns undefined #12767

kiastorm opened this issue Oct 14, 2020 · 3 comments
Assignees
Milestone

Comments

@kiastorm
Copy link

kiastorm commented Oct 14, 2020

Describe the bug
A clear and concise description of what the bug is.

Consider the following code

View.argTypes = {
    zoom: {
        defaultValue: 0,
        control: { type: 'number' },
    }
}

If I then log the output of args.zoom in my story, it returns undefined (because it is falsey, I believe)

If I set the defaultValue to 1, when logged it returns 1

To Reproduce
Steps to reproduce the behavior:

1 - Set argType default value to 0
2 - Log output inside story

Expected behavior
A clear and concise description of what you expected to happen.

defaultValue: 0

console.log(args.zoom) // 0

Is this my own error or is it a bug?

@shilman shilman self-assigned this Oct 15, 2020
@shilman shilman added this to the 6.1 args milestone Oct 15, 2020
@shilman shilman modified the milestones: 6.1 args, 6.2 args Nov 24, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

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!

@stale stale bot added the inactive label Dec 25, 2020
@stale stale bot removed the inactive label Feb 8, 2021
@shilman shilman removed their assignment Feb 8, 2021
@tmeasday
Copy link
Member

@shilman
Copy link
Member

shilman commented Feb 20, 2021

¡Ay Caramba!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.2.0-alpha.30 containing PR #13919 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 Feb 20, 2021
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

3 participants