Skip to content

Unable to override defaultValue false using Story.args #612

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

Open
ddubrava opened this issue Mar 26, 2025 · 1 comment
Open

Unable to override defaultValue false using Story.args #612

ddubrava opened this issue Mar 26, 2025 · 1 comment
Labels
needs triage needs to be reviewed

Comments

@ddubrava
Copy link

ddubrava commented Mar 26, 2025

Describe the bug

If defaultValue in Story.argTypes is set to false, it cannot be overridden by a value in Story.args. This behavior occurs only when the default value is false. If it is set to true, the value can be changed to false through the story configuration. Same for 0/1

Reproduction

https://stackblitz.com/edit/ladle-rj7vgnvr

Environment

  • OS: MacOS
  • Browser: Chrome
  • Version: Chrome 134
@ddubrava ddubrava added the needs triage needs to be reviewed label Mar 26, 2025
@ddubrava
Copy link
Author

ddubrava commented Mar 26, 2025

defaultValue: args[argKey] ? args[argKey] : argValue.defaultValue,

value: args[argKey] ? args[argKey] : argValue.defaultValue,

All "falsy" values use the defaultValue. Replace it with undefined, please

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

No branches or pull requests

1 participant