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
args values not present in url are casted to !undefined for controls of type select and radio #17063
Comments
This is also happening on page reflow (after resizing to bigger/smaller window), and when opening a story iframe for me. |
This is also happening on version 6.4.19 but not on version 6.3.12 |
We had to downgrade to For us it was happening for "picker" types (e.g. radio and dropdown) when we were using string literals in TypeScript. If we defined the argType explicitly (i.e. as |
This is also happening to me on storybook |
Also having big problems with this - the same as other people are reporting, when using dropdowns in a story, all args are going to !undefined in the URL on refresh (including when resizing the window down small enough) |
@shilman Do you have any idea if this bug will be fixed in This bug does make demoing my Storybook seem function quite janky. I would like not to have to downgrade to a previous version as I am using other new features in CC @ndelangen 😃 |
@shilman @ndelangen Any update from core maintainers on whether this bug is deemed a priority or not? Is it slated to be fixed in an update? Looking at downgrading to older version of Storybook here as this is very confusing bug that is causing issues for my team when reviewing our component library. Anybody on the thread have any workarounds? |
We are in the same position, we may have to go back to a previous version as this bug is making Storybook almost unusable for development - every time you change a file that causes a reload, it looses all the select args and you have to manually edit the URL to remove the args= querystring. We can't find any workarounds other than doing that manually every time it reloads. |
Yep downgrading to 6.3 is likely my next step, and commenting out the
interactive testing features I have been trying out.
I'm guessing this bug thread is being drowned in the hundreds of other open
issues on the Storybook repo.
…On Thu, Apr 7, 2022, 2:15 PM Paul Woodland ***@***.***> wrote:
We are in the same position, we may have to go back to a previous version
as this bug is making Storybook almost unusable for development - every
time you change a file that causes a reload, it looses all the select args
and you have to manually edit the URL to remove the args= querystring. We
can't find any workarounds other than doing that manually every time it
reloads.
—
Reply to this email directly, view it on GitHub
<#17063 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSV2QSCQPTDESQACPQQUU3VD4Q3DANCNFSM5KSVKZ7A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Still happen in the lastest release 6.5.0-alpha.63... |
We're already on Also, for us, it's not happening for select or radio specifically. It's happening with object type props. This is preventing people from reloading storybook pages or sharing urls. Args are marked as |
I fixed it in my project by copying the if (args[key] === undefined || options.includes(args[key]) || isValidArray) {
if (key in args) acc[key] = args[key]; // origin code: acc[key] = args[key];
return acc;
} I am using pnpm to manage my project, so I add "pnpm": {
"overrides": {
"@storybook/store": "link:store"
}
} |
Thank you @evont for looking into it! I've tried applying your fix using patch/patch-commit in Yarn, and so far I haven't seen the bug happen (whereas it did happen all the time), so fingers crossed it's sorted it, but I'll keep an eye on it. Hopefully your fix #17973 gets included in the main Storybook release for everyone soon! |
This is also happening to me on storybook |
Great Caesar's ghost!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.5.0-beta.6 containing PR #18135 that references this issue. Upgrade today to the
Closing this issue. Please re-open if you think there's still more to do. |
Thanks @shilman! Is this going to be ported to v6.4.x? |
It would be nice if there was a port to |
still happening in 6.4.22. Any advice on how to fix this without upgrading to 6.5? |
@jbenjoy2 no that won't happen; you'll need to upgrade to get the fix. |
Describe the bug
If the url contains at least one arg, all arguments for controls of type
select
orradio
that have no arg present in the url are casted to undefined.To Reproduce
1.) Checkout the repro:
2.)
yarn storybook
3.) Open the story: http://localhost:6006/?path=/story/test-args--bob
4.) Change value for
foo
frombar
tobaz
as expected URL changes to: http://localhost:6006/?path=/story/test-args--bob&args=foo:baz5.) Copy URL and open in another browser or refresh the tab
6.) URL changes to http://localhost:6006/?path=/story/test-args--bob&args=first:!undefined;last:!undefined;foo:baz
7.) No args for
first
andlast
are passed to the story. Default args should be passed.System
The text was updated successfully, but these errors were encountered: